Testing age assurance in sandbox
Check that your app responds correctly to age assurance scenarios and consent revocation using the sandbox environment.
Overview
You can provide parents and guardians with the ability to make decisions about whether their child can continue to access your app or parts of your app. Declared Age Range API enables you to request people’s age and create custom experiences based on the information they share, and PermissionKit gives you the ability to provide parents or guardians the opportunity to decide if their child can continue using your app or parts of your app after a significant update. Make sure your app implements age restrictions and processes permission revocation as parents or guardians instruct.
In the sandbox environment you can test how your app responds to various age range scenarios, location-based restrictions, approval state changes, and consent revocation. Focus on testing age range variations across your target audience, and consider regulatory compliance in different regions.
Navigate to your Sandbox Apple Account settings
Confirm that you have enabled Developer Mode. If you haven’t, see Enabling Developer Mode on a device.
Open Settings and select Developer.
Scroll down to Sandbox Apple Account.
If you’re not logged in to an account, select Sign In to authenticate yourself.
Once you’ve authenticated, select your Apple Account.
Test age assurance on device
Follow the steps from “Navigate to your Sandbox Apple Account.”
In the Sandbox Apple Account modal, select Manage.
Scroll down and select Age Assurance or Revoke App Consent.
When you select a scenario, the Declared Age Range API returns the corresponding upperBound, lowerBound, and ageRangeDeclaration values, and PermissionKit returns the associated response status. Refer to the following table to check the specific values returned for each test case.
Test case | Lower bound | Upper bound | Age declaration | Significant app update notification | PermissionKit response |
|---|---|---|---|---|---|
Under 13, approved | — | 12 | True | ||
Ages 13 - 15, approved | 13 | 15 | True | ||
Ages 16 - 17, declined | 16 | 17 | True | ||
18+, self declared | 18 | — | False | ||
18+, payment checked | 18 | — | False |
Check the AgeRangeDeclaration field in your Declared Age Range API responses to determine status.
Test app consent revocation
To test the notification when a parent or guardian revokes access to your app on behalf of their child, follow these steps:
Follow the steps from “Navigate to your Sandbox Apple Account.”
In the Sandbox Apple Account modal, select Manage.
Scroll down and select Revoke App Consent.
Enter your app’s Bundle ID (for example, com.example.bundle).
Tap Revoke Consent to simulate the revocation.
Confirm that the system displays “Notification Triggered” with the message “A notification will be sent to the developer server soon.”
If you have App Store Server Notifications V2 enabled, your server receives a RESCIND_CONSENT notificationType. The notification payload includes an appData object with app metadata, including the bundleId and environment fields that help you check the notification applies to the correct app and test environment.
Create region-specific sandbox test accounts
To test age assurance flows in different regions, create sandbox test accounts with specific App Store territories in App Store Connect.
Sign in to App Store Connect.
Go to Users and Access.
Select the Sandbox tab in the left sidebar.
Click Test Accounts.
Click the Add button (+) to add a new test account and fill in the required fields: First Name / Last Name, Email Address, Password, Date of Birth, and App Store Territory.
In the App Store Territory pull-down menu, choose the storefront the sandbox account simulates. Choose from any available App Store regions.
Click Create to finalize the sandbox tester account.