Test your app's permission prompts before launch
· 7 min read
Your app asks for the camera, photos or location, and a stranger taps "Don't Allow". What happens next? In too many apps, the screen goes blank, a button does nothing, or the app crashes. You never see it, because you tapped "Allow" months ago. I read the official iOS, Android and web docs on 11 November 2026. This post is what they say, and how to test it.
Short answer: ask when the person uses the feature, explain why in one plain sentence, keep the app working after a "No", and test each answer on a fresh install. Ask testers to try the "No" path on purpose.
Why this matters
If a person says no and your app breaks, they will not come back. The first minute has other traps, covered in test the first 60 seconds of your app. Notifications are a separate permission, covered in test push notifications before launch.
iOS: purpose strings and the "No" answer
Apple's page on requesting access to protected resources says: "Always provide a valid purpose string in the Signing and Capabilities editor if your app uses a protected resource. If you don't, attempts to access the resource fail, and might cause your app to crash." It also says App Review "rejects apps that contain code accessing those resources without a purpose string". The page says this includes resources an SDK or library touches, so check your dependencies too.
What should the string say? Apple's privacy guidelines say to "Aim for a brief, complete sentence that's straightforward, specific, and easy to understand." The App Review Guidelines, section 5.1.1 (ii), say "Ensure your purpose strings clearly and completely describe your use of the data." "Camera needed" is weak. "Scan a receipt so we can add it to your expenses." is better.
On timing, the privacy guidelines also say: "Ideally, wait to request permission until people actually use an app feature that requires access." The App Review Guidelines add, in 5.1.1 (iv): "Where possible, provide alternative solutions for users who don't grant consent. For example, if a user declines to share Location, offer the ability to manually enter an address."
Photos and location have more than yes and no
Apple's PhotoKit privacy page says that starting in iOS 14, "they can share a limited subset of their photos and videos". The prompt then has a "Select Photos" option, and your app only sees the items picked. In that mode you "can't create or fetch user albums", so test any album screen with limited access. For a plain photo pick, the system picker means "The user doesn't need to explicitly authorize your app to select photos".
For location, Apple's protected resources page says the person "can choose to allow access for one session only by tapping Allow Once." Test that too.
Seeing the prompt again on iOS
The same page says the system "remembers the person's choice and doesn't prompt again". To get the prompt back, it says to go to "Settings > General > Transfer or Reset iPhone > Reset > Reset Location & Privacy". That resets privacy settings for all apps, so use a test device. It also says: "Because a person can change authorization at any time using Settings, always check the authorization status of a feature before accessing it."
Android: runtime permissions and the "second No"
Android's guide to requesting runtime permissions gives the first principle as "Ask for a permission in context, when the user starts to interact with the feature that requires it." When shouldShowRequestPermissionRationale() returns true, show a screen that explains why. "Don't block the user." If the person says no, "gracefully degrade your app", for example by turning off only the feature that needs it.
The guide also says to "Be specific" about what is off, and warns that "persistent nagging to reconsider is not respectful of their choice."
The big trap is this: "if the user taps Deny for a specific permission more than once during your app's lifetime of installation on a device, the user will no longer see the system permissions dialog if your app requests that permission again." Your button then does nothing. Test it: deny twice, then tap the feature button a third time.
One-time and approximate
Starting in Android 11, the guide says, the dialog for location, microphone or camera has an option called "Only this time". If the person revokes access later, "your app's process terminates", and the feature asks again next time. So test access disappearing while the app runs.
For location, Android's location permissions page says: "Your app should still work when the user grants only approximate location access."
Resetting on Android
The same guide says adb shell dumpsys package PACKAGE_NAME flags a permission with USER_FIXED after two denials. To reset it, it gives this command:
adb shell pm clear-permission-flags PACKAGE_NAME PERMISSION_NAME user-set user-fixedWeb apps
MDN says getUserMedia() "can only be used in secure contexts; in insecure contexts, navigator.mediaDevices is undefined". So test on your HTTPS link. MDN's getUserMedia page also says: "If the user denies permission, or matching media is not available, then the promise is rejected with NotAllowedError or NotFoundError DOMException respectively." It adds that the promise may "neither resolve nor reject", because "the user is not required to make a choice at all and may ignore the request." So a spinner that waits forever is a bug to test for.
To read the state without asking, MDN's Permissions API page says Permissions.query() returns a promise with the status, and "If the permission status is prompt, the user must acknowledge a prompt to grant access to the feature." The page doesn't say how a person unblocks a site, so tell testers to check their browser's site settings.
Flutter, React Native and Expo
These use the native prompts above. Expo's permissions guide says the default messages "will most likely need to be tailored to your specific use case". The OS "prohibits an app from asking for the same permission more than once", so "you may need to uninstall and reinstall the native app" to test again.
The paths to test
On a fresh install, go through these one by one:
- First ask, Allow. Check the prompt came when the feature was used. Pass if the person knew why it asked.
- First ask, Don't Allow. Check there is no crash, blank screen or spinner. Pass if the app says what is off and the rest still works.
- Deny twice (Android). Tap the feature again. Pass if the app does not look broken when no dialog appears.
- Allow Once or Only this time. Close the app, open it again, use the feature. Pass if asking again feels fine.
- Limited photos or approximate location. Pick a few photos, or approximate only. Pass if the feature still works.
- Turned off later in Settings. Switch it off while the app is open, then come back. Pass if the app notices and does not crash.
- Reinstall. Pass if the prompt comes back, and only when the feature is used.
A test task testers can follow
A tester only does the "No" path if you ask. For the general method, see how to write a test task. Paste this:
Install the app fresh. Every time it asks for access
(camera, photos, location, mic), tap No or Don't Allow.
Then try each feature that needs it.
Tell me: did anything crash, go blank or stop
responding? Did the app explain how to turn access on?
Then turn access on and repeat. Tell me your phone
and OS version.You also need phones that are not yours: see testing on phones you don't own. For other rejection causes, read first App Store rejection: common issues.
Where TestSwap fits
TestSwap is a free app testing exchange where indie developers test each other's apps. You can post a web, iOS or Android app with a link testers can open or install, like a TestFlight link or a Google Play testing link. You can add a test login, which only signed-in testers can see. Everyone starts with 3 credits. Writing a review earns 1, and each review your app receives costs 1. The maker can rate each review 👍 or 👎, and a 👎 takes back the credit the reviewer earned. TestSwap is not affiliated with Apple or Google.
Permission checklist
- Does every permission have a specific purpose string, including ones from libraries?
- Does the app work after "Don't Allow", and say which feature is off?
- Is there an alternative, like typing an address?
- Did you test the second denial on Android?
- Did you test limited photos, approximate location, and access turned off while the app was open?
- Do web features handle a denied or ignored prompt?
- Does the test task ask testers to tap No first?
Try it
Pick one permission. Reinstall your app and tap No. If it breaks, you found the bug before your users did. Then post your app on TestSwap. Tell me what's missing or broken (@dizid on X).