How it works
Phones protect sensitive things (camera, microphone, location, photos, contacts) behind runtime permissions: the app must ask the user while it runs, through a system dialog (a pop-up drawn by iOS or Android, not by the app) that the app can’t change or fake. “Runtime” simply means “while the app is running”, as opposed to when it is installed.
- The app declares what it may need. On iOS, each permission needs a purpose stringPurpose stringOn iOS, the text an app must provide explaining why it needs a permission; shown in the system dialog.Open in glossary →: a sentence the developers write to say why the app wants access (“We use your location to find your delivery address”). It’s shown inside the dialog. On Android, the developers list every permission the app may ask for. Without this declaration, the app can’t ask at all (on iOS it usually crashes when it tries).
Dev note
iOS: the usage description keys inInfo.plist, for exampleNSCameraUsageDescription. Android:<uses-permission>entries inAndroidManifest.xml. - The app checks the current status. Not asked yet, allowed, allowed once, denied, or denied for good. It must check every time it needs the permission, because the user can change it any time in Settings.
- The app asks (if allowed to). Ideally right when the user starts the feature, after a short explanation in the app’s own UI (permission primingPermission primingExplaining in the app why a permission is needed, at the right moment, before the system dialog.Open in glossary →). The OS then shows its dialog.
- The user answers. Allow, allow once, or don’t allow. For location also precise (the exact spot) or approximate (only the rough area).
- The app handles every answer. Allowed: the feature works. Denied: the feature explains what’s missing and offers Open Settings (a deep linkDeep linkA link that opens a specific screen inside an app instead of just its home screen.Open in glossary → to the app’s page in system Settings), and the rest of the app keeps working.
- The user changes their mind later. In system Settings, or the OS changes it automatically (one-time grantsOne-time permissioniOS 'Allow Once' or Android 'Only this time': access that expires soon after the user leaves the app.Open in glossary → expire, unused apps lose permissions). The app must notice when it comes back.
The permissions you’ll meet
Two words in this table need a quick explanation. An app is in the foreground while it’s open on the screen, and in the background when the user has switched to another app or locked the phone (more in Background and Foreground). Reading location in the background is far more sensitive, so both systems treat it as a separate, stricter permission.
| Permission | iOS | Android |
|---|---|---|
| Camera, microphone | Allow / Don’t Allow | While using / Only this time / Don’t allow |
| Location | Allow Once / While Using / Don’t Allow, plus Precise on/off. “Always” is a separate, later step. | While using / Only this time / Don’t allow, plus Precise or Approximate. Background (“all the time”) only via Settings. |
| Photos | Limited (selected photos) or Full access | Android 14+: selected photos or all |
| Contacts | Allow, or limited contacts (iOS 18+) | Allow / Don’t allow |
| Notifications | Always needs permission | Needs permission since Android 13 |
| Bluetooth | Permission since iOS 13 | “Nearby devices” since Android 12 |
| Tracking (following the user across other companies’ apps and websites, mostly for ads) | App Tracking Transparency (iOS 14.5+): “Ask App Not to Track” / “Allow” | No equivalent dialog |
Try the real dialogs
Pick a platform and a permission, then tap the answers to see what each means for the app and for your testing:
Snapbite
Allow “Snapbite” to use your location?
We use your location to find your delivery address.
iOS asks once. The map lets the user switch Precise off, so the app only gets an approximate area.
Allow
“While Using App”: location works whenever the app is in use. “Always” (background location) can only be offered later, in a separate step.
Allow once
Location works for this session only. When the app is no longer in use, the permission goes back to “ask”, and the app may show the dialog again next time.
Don’t allow
The dialog will never appear again for this app. Only the Settings app can change the answer, so the app must explain that and link there.
Tap a button in the dialog to highlight what it means. Exact wording differs a little between OS versions and manufacturers.
Every answer is a test case
| Answer | What the app gets | What to test |
|---|---|---|
| Allow / While using | Access whenever the app is in use | The feature works; still works after restart and update |
| Allow once / Only this time | Access for now; it expires when the app is no longer in use | Next launch: the app checks again and asks again, no silent failure |
| Don’t allow (first time) | No access; Android may ask once more | The app explains and keeps working |
| Denied for good | No access, and the dialog will not appear again | The app shows an explanation with Open Settings, not a dead button |
| Approximate location | An area of a few kilometers | Features that need the street still work (confirm on a map, type the street) |
| Limited photos | Only the photos the user picked | The app shows them and offers a way to pick more |
“Don’t ask again”: when the dialog stops appearing
- iOS shows each permission dialog once. After “Don’t Allow”, asking again does nothing: the OS silently returns “denied”. Only the Settings app can change it.
- Android 11+ lets the app ask again after the first denial (usually after showing an explanation). After the second denial, Android stops showing the dialog and the request fails instantly. (Older Android versions had a “Don’t ask again” checkbox instead.)
So the classic bug is a “Turn on” button that calls the request again: on the developer’s phone it worked once, in real life it does nothing. Once the denial is final, the only working path is Open Settings.
Timing: ask in context
Asking for everything on the first launch is the fastest way to collect “Don’t Allow” answers. Ask when the user starts the feature, and explain the benefit first. The Onboarding lesson has a priming example, and Push Notifications shows why the first moment matters so much for the notification permission.
When permissions change while the app runs
Users can open Settings, change a permission and switch back to the app. What happens next depends on the OS, and it’s a rich source of crashes:
- Android: revoking a permission (taking it away again) shuts the app down behind the scenes, even though it still appears in the list of recent apps. When the user returns, Android recreates the last screen from its saved state (state restorationState restorationBringing the user back to the same screen and data after the OS closed the app in the background.Open in glossary →). If that screen uses the camera or location without checking first, it crashes. Granting a permission does not restart the app.
- iOS: for many privacy permissions (camera, microphone, photos, contacts), turning access off in Settings ends the app, which then starts fresh. Apple barely documents this, but it’s long-standing behavior you’ll see in practice. Location changes are usually reported to the running app instead. Either way, the app must re-check the status when it becomes active.
The OS changes permissions too
- One-time grants expire: iOS “Allow Once” and Android “Only this time” are gone soon after the user leaves the app.
- Auto-reset for unused apps (Android 11+): if an app isn’t opened for a few months, Android removes its permissions. A user returning after a long break meets the dialogs again.
- OS updates add new permissions: an app that worked on Android 12 may need the notification permission on Android 13, or the new photo permissions on Android 13 and 14. That’s why OS versionOS versionWhich version of iOS, Android or another operating system a device runs.Open in glossary → coverage matters here.
Example requirements
Check this part
On iOS a user tapped "Don't Allow" for the camera. What happens when the app requests the camera again?
On Android 11 or newer, when does the system stop showing the permission dialog?
On Android you revoke the camera in Settings while the camera screen is open. When you return, the app crashes. Why?