πŸ”ž Age Safety β€” JS Bridge Test

Test WTN.AgeSafety.getAgeSignals and WTN.AgeSafety.notifySignificantChange using the official platform testing APIs β€” FakeAgeSignalsManager on Android and the Sandbox Apple Account on iOS. All test wiring is debug-only; release builds always call the real APIs.

DEBUG ONLY βœ“ WebToNative v1

SDK Status

Checking WTN.AgeSafety…

Android β€” FakeAgeSignalsManager

getAgeSignals Android + iOS

Android debug builds use FakeAgeSignalsManager from com.google.android.play:age-signals-testing. Pick any scenario β€” the fake manager returns it instantly without a Google account or signed APK. In release builds, testScenario is ignored and the real API is called.

Ignored in release builds β€” real AgeSignalsManagerFactory is used instead.
Waiting for call…
// Android: passes testScenario to FakeAgeSignalsManager (debug only)
WTN.AgeSafety.getAgeSignals(
  { "ageGate": 18, "testScenario": "SUPERVISED" },
  function(value) { /* value printed above */ }
);

iOS β€” Sandbox Apple Account

iOS Sandbox Setup iOS only

iOS testing uses the Sandbox Apple Account built into Developer Settings β€” no code changes needed. The sandbox configures what AgeRangeService.requestAgeRange() returns on device.

  1. Enable Developer Mode on your device (Settings β†’ Privacy & Security β†’ Developer Mode)
  2. Open Settings β†’ Developer β†’ Sandbox Apple Account
  3. Sign in if prompted, then tap Manage
  4. Scroll to Age Assurance and select a test case from the table below
  5. Run the getAgeSignals call β€” the API returns the sandbox values instantly
Sandbox Test Case lowerBound upperBound ageRangeDeclaration PermissionKit response
Under 13, approvedβ€”12guardianPaymentChecked.approve
Ages 13–15, approved1315guardianPaymentChecked.approve
Ages 16–17, declined1617guardianPaymentChecked.decline
18+, self declared18β€”selfDeclaredAskError.notAvailable
18+, payment checked18β€”paymentCheckedAskError.notAvailable
Note: For users 18+, notifySignificantChange (PermissionKit) throws AskError.notAvailable β€” adults don't require parental permission. This is correct behaviour, not an error in your code.

iOS β€” Revoke App Consent iOS only

Simulate a parent revoking access so you can test how your app handles the RESCIND_CONSENT server notification.

  1. Go to Settings β†’ Developer β†’ Sandbox Apple Account β†’ Manage
  2. Tap Revoke App Consent
  3. Enter your app's Bundle ID (e.g. com.webtonative.appbuilder…)
  4. Tap Revoke Consent β€” confirm the "Notification Triggered" toast
  5. If App Store Server Notifications V2 is enabled your server receives a RESCIND_CONSENT event with bundleId and environment fields

iOS β€” PermissionKit

notifySignificantChange iOS only Β· iOS 26.2+

On a real iOS 26.2 device with a sandbox under-18 account configured, AskCenter.shared.ask() shows the actual system sheet. In Simulator (or when iOS < 26.2) the #if DEBUG path fires a success callback instantly so the JS bridge flow can still be verified.

Waiting for call…
WTN.AgeSafety.notifySignificantChange(
  { "topicString": "We added parental controls…" },
  function(value) { /* value printed above */ }
);