Question about testing the Declared Age Range feature

I’m integrating the Declared Age Range feature to tailor our app’s experience based on a user’s age range. I’m currently in the testing phase and would like to repeatedly test the consent flow and different outcomes from AgeRangeService.shared.requestAgeRange(...).

However, once I go through the consent flow and choose to share, the age-range sharing sheet no longer appears on subsequent attempts—so it’s hard to validate edge cases (e.g., changed gates, declined flow, re-prompt behavior).

Could you advise on the recommended way to reset or re-prompt during development? In particular:

Is there a supported way to clear per-app consent so the system prompts again?

Under what conditions should the “Share Age Range Again” control appear in Settings, and is there an equivalent way to trigger it for testing?

Are there best practices for QA (e.g., using Ask First at the system level, testing on real devices vs. Simulator, using a separate bundle ID for dev builds, or other steps)?

Any other guidance for validating different requestAgeRange results (e.g., declined/not available) would be appreciated.

Answered by DTS Engineer in 862153022

Is there a supported way to clear per-app consent so the system prompts again?

There is no supported way to achieve the desired functionality given the currently shipping system configurations.

If you would like for Apple to consider adding support for such features, please submit your suggestion request via Feedback Assistant. For more information on Feedback Assistant, please visit https://developer.apple.com/bug-reporting.

Under what conditions should the “Share Age Range Again” control appear in Settings, and is there an equivalent way to trigger it for testing?

It appears prior to the anniversary of the original request, and when a user previously declined or a user has aged out of a current age range.

Are there best practices for QA (e.g., using Ask First at the system level, testing on real devices vs. Simulator, using a separate bundle ID for dev builds, or other steps)?

Testing in the Simulator is unsupported. If you use a separate bundle ID, the system treats it as a different app.

Any other guidance for validating different requestAgeRange results (e.g., declined/not available) would be appreciated.

Please clarify what you mean in the above text.

I have no chance to use this feature as I do not find the relevant header files. I added the Framework and the Capability. But still I do not have any chance to compile my code. Are you able to share a short snippet of your code?

Accepted Answer

Is there a supported way to clear per-app consent so the system prompts again?

There is no supported way to achieve the desired functionality given the currently shipping system configurations.

If you would like for Apple to consider adding support for such features, please submit your suggestion request via Feedback Assistant. For more information on Feedback Assistant, please visit https://developer.apple.com/bug-reporting.

Under what conditions should the “Share Age Range Again” control appear in Settings, and is there an equivalent way to trigger it for testing?

It appears prior to the anniversary of the original request, and when a user previously declined or a user has aged out of a current age range.

Are there best practices for QA (e.g., using Ask First at the system level, testing on real devices vs. Simulator, using a separate bundle ID for dev builds, or other steps)?

Testing in the Simulator is unsupported. If you use a separate bundle ID, the system treats it as a different app.

Any other guidance for validating different requestAgeRange results (e.g., declined/not available) would be appreciated.

Please clarify what you mean in the above text.

Question about testing the Declared Age Range feature
 
 
Q