---
title: "Ask for each permission when the feature · Agent Wranglers"
url: https://agentwranglers.se/playbook/mobile-apps/privacy-declarations/permission-in-context
updated: 2026-10-21
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Ask for each permission when the feature needs it

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Privacy declarations](https://agentwranglers.se/playbook/mobile-apps/privacy-declarations.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

- ID: MOB-30
- Level: Recommended
- Chapter: [Privacy declarations](https://agentwranglers.se/playbook/mobile-apps/privacy-declarations)
- Rule: Ask for camera, location, contacts and other permissions at the moment a feature needs them, never at first launch. Each iOS purpose string says what the data is used for.
- How: A prompt with no context gets a no, and a no is hard to undo. Show the feature first, then ask when the person taps it. Apple requires a purpose string, such as `NSCameraUsageDescription`, for each protected API, and rejects vague ones. Paid features must not depend on a yes. After a no, explain what is missing and link to the system settings. Push permission has its own rule, [ask for permission after a clear action](https://agentwranglers.se/playbook/notifications/push-notifications/push-permission-in-context).
- Check: A fresh install shows no permission prompt before the first screen. Each purpose string names the feature, and every feature works or explains itself after a no.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### Plain text example

```swift
func scanReceiptTapped() async {
    guard await AVCaptureDevice.requestAccess(for: .video) else {
        router.show(.cameraOffExplainer)
        return
    }
    router.show(.receiptScanner)
}
```

### Kotlin example

```kotlin
private val askCamera = registerForActivityResult(ActivityResultContracts.RequestPermission()) { granted ->
    if (granted) openReceiptScanner() else showCameraOffExplainer()
}

fun onScanReceiptTapped() = askCamera.launch(Manifest.permission.CAMERA)
```

## Sources

- [App Review Guidelines 5.1.1 Data Collection and Storage](https://developer.apple.com/app-store/review/guidelines/#data-collection-and-storage)
- [Apple, NSCameraUsageDescription](https://developer.apple.com/documentation/bundleresources/information-property-list/nscamerausagedescription)

## Related rules

- [Ask for permission after a clear action](https://agentwranglers.se/playbook/notifications/push-notifications/push-permission-in-context) in Notifications

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/mobile-apps/privacy-declarations/permission-in-context">Agent Wranglers mobile apps playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Ask before any tracking](https://agentwranglers.se/playbook/mobile-apps/privacy-declarations/tracking-permission)
- [Privacy declarations](https://agentwranglers.se/playbook/mobile-apps/privacy-declarations)
