System permissions on iOS
When a flow runs the Request permission action, the Adapty SDK sends the permission request to your app. Your app shows the system dialog and passes the result to the flow. Follow this reference to write the iOS code that passes the result of each permission request to the flow. For each permission that the action can request, this page describes:
- What users see.
- What your app declares, and how it requests the permission.
- The responses that iOS can give to each permission request.
- How your app passes each response to the flow, as a result and its argument.
Set up the permission handler
Main article: Handle permission requests in flows
Before you follow this reference, set up a permission handler: the code in your app that receives each permission request and passes the result back. This page only covers what to request and which result to pass for each permission.
Add the request to a flow
Main article: Request permissions in a flow
To ask users for a system permission, in the Flow & Paywall Builder, add the Request permission action to a screen of your flow.
How to pass the result
Return the result
In the handlePermission(_:withCustomArgs:) method, return .granted or .denied, with the argument from the table of the permission. For example, this camera function returns the result of a camera request: granted, declined in the alert, declined before the request, or blocked by a device policy.
import AdaptyUI
import AdaptyUIBuilder
import AVFoundation
extension FlowPermissionHandler {
func requestCamera() async -> AdaptyPermissionResult {
switch AVCaptureDevice.authorizationStatus(for: .video) {
case .authorized:
return .granted("granted")
case .denied:
// The user declined earlier: iOS shows no alert.
return .denied("permanently_denied")
case .restricted:
return .denied("restricted")
case .notDetermined:
let granted = await AVCaptureDevice.requestAccess(for: .video)
return granted ? .granted("granted") : .denied("denied")
@unknown default:
return .denied(nil)
}
}
}If your app uses a cross-platform SDK React Native, Flutter, Unity, Kotlin Multiplatform, or Capacitor , pass the same values with the call that its guide shows.
Prepare the handler for each system response
For each permission, iOS reports one of several authorization statuses. The table in each permission section lists every status, and the result that your handler returns for it. Your code for a permission needs one case for each row. For example, the camera function above has a case for each row of the camera table.
What the flow does with the result
After your app passes the result, the flow runs the After response actions. The default action is Navigate Next, so users go to the next screen whether they grant the permission or decline it. Without an After response action, users stay on the screen.
To send users who grant the permission and users who decline it to different screens, add actions to When allowed and When denied. The flow then runs these actions instead of the After response actions:
- When allowed actions: After the user grants the permission.
- When denied actions: After your app passes
denied,restricted, orpermanently_deniedto the flow.
If the only When allowed or When denied action is Do nothing, the flow moves on to the After response actions. To keep users who decline on the screen, remove every action from After response. Users who grant the permission then need their own way forward: add Navigate Next to When allowed.
Pass the argument (in React Native and Capacitor, the detail property) that matches the result:
- For a granted result:
granted. Uselimitedif the user granted part of the access, such as a selection of photos. Useprovisionalfor provisional authorization, which iOS grants in two cases:- Push notifications: If your app requests provisional authorization, iOS grants it without asking the user. The notifications then arrive quietly, in the Notification Center only, until the user decides to keep them or turn them off.
- Location always: iOS asks for Always access in two alerts. Allow While Using App in the first alert grants Always access until the second alert. iOS shows the second alert when the app first needs location in the background. In it, the user selects Keep Only While Using or Change to Always Allow.
- For a not-granted result:
denied. Userestrictedif a device policy, such as parental controls, blocks the permission. Usepermanently_deniedif the system no longer shows the dialog to the user. - For a permission your app doesn’t request:
unsupported, with a not-granted result and no dialog. - When the user made no choice: No argument. For example, the user closed the dialog, or the OS reported no decision before the timeout in your code. The flow then runs the After response actions.
Pass the arguments in lowercase, exactly as written. For a not-granted result with any other argument, such as Denied or an error message, the flow runs the After response actions.
Rules for every permission
-
Only write code for the permissions your app uses: When your app code calls an API that requests a permission, such as the
CLLocationManagerclass for location access,Info.plistneeds a purpose string for that permission. A purpose string is the text inInfo.plistthat tells users why your app needs the permission.Info.plistneeds this string even if a flow never requests the permission. Apple notes that libraries and SDKs can reference APIs that require a purpose string too. If a flow requests a permission that your app doesn’t use, return.denied("unsupported")without a request. Onedefaultcase in theswitchstatement of your handler covers all of these permissions. -
Read the authorization status before you request the permission: Your app can read the authorization status without an alert. For example, the
AVCaptureDevice.authorizationStatus(for:)method returns the status of camera access. If the status shows that the user or a device policy decided the permission before this request, don’t call the request method. Pass the result for this status from the table of the permission.iOS shows each permission alert once per app install, because iOS keeps the user’s choice. The following permissions are exceptions:
- Location: After Allow Once expires, the location alert appears again. In a second alert, the user can upgrade access to Always or to precise location. The alert that asks for precise location can appear again in a later session.
- Health data: The Health access sheet appears again for each data type that the app requests for the first time.
- App tracking (ATT): In the EU, one year after the user grants or declines tracking in the alert, the app can ask again.
- Calendar: On iOS 17 and later, after the user grants write-only access, the first request for full access shows a second alert.
Outside these exceptions, a request for a decided permission shows no alert. Most request methods return the stored decision. Some never call back: for example, when the authorization status isn’t
.notDetermined, theCLLocationManager.requestWhenInUseAuthorization()method does nothing and doesn’t call thelocationManagerDidChangeAuthorization(_:)delegate method. After the first call to therequestAlwaysAuthorization()method, further calls have no effect. -
Wait for indirect requests with a timeout: iOS has no request method for Bluetooth, Motion & Fitness, Local network, and HomeKit. The alert appears when the app first uses the framework. iOS reports the user’s choice to a delegate method or a query handler, or doesn’t report it at all. Wrap the wait in a timeout shorter than 60 seconds. Then pass the result for the current authorization status, or a not-granted result without an argument. After 60 seconds without a result, the flow reports the
flow_permission_unansweredevent and can send the next permission request. If your app then passes a late result for the first request, the flow can run the actions of the next request. -
Tell a new refusal from an earlier refusal: In your analytics, you can tell users who declined the permission in the flow from users who declined it earlier. Both cases run the When denied actions. iOS keeps every refusal until the user changes it in Settings. Pass
deniedwhen the user declined the alert of this request. Passpermanently_deniedwhen iOS showed no alert because the user declined before. -
Don’t reuse an earlier result: Some grants expire. Allow Once in the location alert lasts while the app is in use. Temporary full accuracy expires on its own. Don’t store a result for a later request.
-
Reset the user’s decisions when you test: To see an alert again, delete the app, or open Settings > General > Transfer or Reset iPhone > Reset > Reset Location & Privacy, which resets every app. Deleting the app doesn’t reset every permission: Bluetooth access, for example, can survive a reinstall of the same bundle ID. To see the first alert again, use a build with a new bundle ID.
Notifications and tracking
Push notifications
- What the user sees: An alert that asks for permission to send notifications.
- Setup: The permission needs no key in
Info.plist. Request the permission with theUNUserNotificationCenter.requestAuthorization(options:)method. To receive remote push notifications, the app also needs the Push Notifications capability and registers with APNs. The permission itself doesn’t need them.
Pass the result that matches the notification authorization status:
| What iOS reports | Result to pass |
|---|---|
.notDetermined, then the user grants the permission | Granted, granted |
.notDetermined, then the user declines | Not granted, denied |
.denied before the request | Not granted, permanently_denied |
.authorized, or .ephemeral in an App Clip | Granted, granted |
.provisional, after a request with the .provisional option | Granted, provisional |
requestAuthorization(options:) throws an error | Not granted, no argument |
- Limitations: iOS shows the alert once: later requests return the first decision. For a request with the
.provisionaloption, iOS delivers notifications quietly, without asking the user first. They only appear in the Notification Center. The flow runs the When allowed actions right after this request. Use the.provisionaloption only if the flow expects that.
App tracking (ATT)
- What the user sees: The App Tracking Transparency alert with your purpose string. In France, Germany, Italy, Poland, and Romania, iOS shows a full-page sheet instead of the alert. iOS shows nothing and returns the current authorization status when tracking is restricted, or when the user turned off Allow Apps to Request to Track in Settings. iOS also shows nothing when another request waits for the user’s choice, the request comes from an app extension, or the app isn’t active.
- Setup: Add the
NSUserTrackingUsageDescriptionkey toInfo.plist. An app that uses the AppTrackingTransparency framework without this key crashes. For the full-page sheet, you can add theNSUserTrackingMarkdownUsageDescriptionkey. Request the permission with theATTrackingManager.requestTrackingAuthorization()method.
Pass the result that matches the tracking authorization status:
| What iOS reports | Result to pass |
|---|---|
.notDetermined, then the user grants the permission | Granted, granted |
.notDetermined, then the user declines | Not granted, denied |
.denied before the request. In the EU, less than a year after the user declined tracking in the alert | Not granted, permanently_denied |
.restricted | Not granted, restricted |
.authorized | Granted, granted |
.notDetermined after the request: iOS closed the prompt without a decision, the app wasn’t active, or another request waited for the user’s choice | Not granted, no argument |
- How to pass the result:
-
Request tracking only while the app is active: iOS shows the alert only to an active app. An On Screen Appear request on the first screen after launch can arrive before the app is active, so before you request:
- Read the
UIApplication.shared.applicationStateproperty. - If the app is active, request immediately.
- Otherwise, wait for the
UIApplication.didBecomeActiveNotificationnotification, then request. Wrap the wait in a timeout shorter than 60 seconds: after 60 seconds without a result, the flow reports theflow_permission_unansweredevent. If the timeout ends first, pass a not-granted result without an argument.
Read the property first, because an app that is already active never receives this notification.
- Read the
-
In the EU, one year after the user grants or declines the tracking permission, the app can ask again. This doesn’t apply when the user turned tracking off in Settings. Store the date of the user’s choice, and after a year, request again instead of returning
.denied("permanently_denied"). See therequestTrackingAuthorizationmethod. -
After the user grants or declines tracking, send the tracking authorization status to Adapty. If your app uses a cross-platform SDK React Native, Flutter, Unity, Kotlin Multiplatform, or Capacitor , send the status with the method of that SDK.
-
Location
Location while using the app
- What the user sees: An alert with Allow Once, Allow While Using App, and Don’t Allow, and a Precise switch.
- Setup: Add the
NSLocationWhenInUseUsageDescriptionkey toInfo.plist. Request the permission with theCLLocationManager.requestWhenInUseAuthorization()method. iOS reports the authorization status to thelocationManagerDidChangeAuthorization(_:)delegate method. When the app creates aCLLocationManagerobject, iOS calls this method with the current authorization status. Ignore.notDetermined, and only pass the result after a change that follows the request. The app must be in the foreground to show the alert.
Pass the result that matches the location authorization status:
| What iOS reports | Result to pass |
|---|---|
.notDetermined, then Allow While Using App or Allow Once | Granted, granted |
.notDetermined, then Don’t Allow | Not granted, denied |
Still .notDetermined after the request, or no decision before the app’s timeout | Not granted, no argument |
.denied before the request, including Location Services turned off and Airplane mode | Not granted, permanently_denied |
.restricted | Not granted, restricted |
.authorizedWhenInUse or .authorizedAlways | Granted, granted |
To report approximate location in analytics, return .granted("limited") instead of .granted("granted"). The flow still runs the When allowed actions.
- How to pass the result: Read the
authorizationStatusproperty first. If it isn’t.notDetermined, pass the result without a request: therequestWhenInUseAuthorization()method does nothing in this case. Otherwise, request the permission, and wrap the wait in a timeout. If theNSLocationWhenInUseUsageDescriptionkey is missing, the request fails without an alert. When the authorization status is already decided, or the key is missing, iOS doesn’t call thelocationManagerDidChangeAuthorization(_:)delegate method. A handler that waits for this method never passes a result, and the flow stays on the screen. - Limitations: Allow Once grants access while the app is in use. The authorization status then returns to
.notDetermined, so the alert appears again later.
Location always
- What the user sees: Two steps.
- Location access not granted or declined yet: The alert for location while using the app. Allow While Using App grants provisional Always access: Always access that the user hasn’t confirmed yet. Later, typically while the app isn’t running, iOS asks the user to select Keep Only While Using or Change to Always Allow.
- Location while using the app already granted: The upgrade alert, with Keep Only While Using and Change to Always Allow, right after the request. After Allow Once, or after an earlier Always request, iOS ignores the request and shows nothing.
- Setup: Add the
NSLocationWhenInUseUsageDescriptionandNSLocationAlwaysAndWhenInUseUsageDescriptionkeys toInfo.plist. Request the permission with theCLLocationManager.requestAlwaysAuthorization()method. Location updates in the background also need the Background Modes capability. The permission itself doesn’t need it.
Pass the result that matches the location authorization status:
| What iOS reports | Result to pass |
|---|---|
.notDetermined, then Allow While Using App in the first alert: .authorizedAlways, provisional Always access | Granted, provisional |
.notDetermined, then Allow Once in the first alert: .authorizedWhenInUse, temporary access | Not granted, denied |
.notDetermined, then Don’t Allow | Not granted, denied |
Still .notDetermined after the request, or no decision before the app’s timeout | Not granted, no argument |
.authorizedWhenInUse, the upgrade alert appears, then Change to Always Allow | Granted, granted |
.authorizedWhenInUse, the upgrade alert appears, then Keep Only While Using | Not granted, denied |
.authorizedWhenInUse, and no alert appears: after Allow Once, or after an earlier Always request | Not granted, permanently_denied |
.authorizedAlways | Granted, granted |
.denied | Not granted, permanently_denied |
.restricted | Not granted, restricted |
- How to pass the result:
- After the request, wait a short time for the alert, such as 2 seconds. iOS shows no alert when the user selected Allow Once earlier, or when the app already requested Always access. If no alert appears, pass the result for the authorization status. If the alert appears, wait until the user closes it, then pass the result. From
.notDetermined, wait until thelocationManagerDidChangeAuthorization(_:)delegate method reports another authorization status: each option in the first alert changes it. From.authorizedWhenInUse, wait until the app becomes active again: while an alert is on the screen, iOS makes the app inactive. Don’t wait for the delegate method after the upgrade alert: iOS doesn’t call it when the user selects Keep Only While Using, because the authorization status doesn’t change. Never wait longer than 60 seconds. - iOS accepts one Always request per install: later calls have no effect. iOS has no API that reports an earlier request. Store a
trueorfalsevalue instead: whether your app requested Always access before. Set the saved value totrueafter the first request.
- After the request, wait a short time for the alert, such as 2 seconds. iOS shows no alert when the user selected Allow Once earlier, or when the app already requested Always access. If no alert appears, pass the result for the authorization status. If the alert appears, wait until the user closes it, then pass the result. From
- Limitations: In the first alert, Allow While Using App reports
.authorizedAlwaysfor provisional Always access, and your app returns.granted("provisional"). Allow Once reports.authorizedWhenInUsefor temporary access, without Always access, so your app returns.denied("denied"). On a later request, your app returns.granted("granted")for provisional Always access. After Allow Once, iOS ignores later Always requests, so your app returns.denied("permanently_denied")for a later request. A user with provisional Always access can select Keep Only While Using later, outside the flow.
Precise location
- What the user sees: If the user turned off Precise in the location alert, iOS shows a second alert when your app requests precise location. In this alert, the user can switch to precise location until the app is no longer in use (Allow Once), or keep approximate location (Don’t Allow). The alert shows the text of your purpose key.
- Setup: Add the
NSLocationWhenInUseUsageDescriptionandNSLocationTemporaryUsageDescriptionDictionarykeys toInfo.plist. Each key of the dictionary is a purpose key, and its value is the text of the alert. Request the permission with theCLLocationManager.requestTemporaryFullAccuracyAuthorization(withPurposeKey:)method. The flow sends no purpose key, so the app code passes one of its own keys.
<key>NSLocationTemporaryUsageDescriptionDictionary</key>
<dict>
<key>StoreFinder</key>
<string>Find the store closest to you.</string>
</dict>Pass the result that matches the location accuracy:
| What iOS reports | Result to pass |
|---|---|
Location .notDetermined, then the user grants location access with Precise on | Granted, granted |
Location .notDetermined, then the user denies location access | Not granted, denied |
Still .notDetermined after the request, or no decision before the app’s timeout | Not granted, no argument |
accuracyAuthorization is .fullAccuracy before the request | Granted, granted |
.reducedAccuracy before, .fullAccuracy after the request | Granted, granted |
The request completes without an error, and accuracyAuthorization is still .reducedAccuracy: the user declined | Not granted, denied |
The request fails with promptDeclined: iOS didn’t show the alert | Not granted, no argument |
Location access .denied | Not granted, permanently_denied |
Location access .restricted | Not granted, restricted |
- How to pass the result:
- The iOS request needs location access while the app is in use. When the location authorization status is
.notDetermined, request Location while using the app first: its alert has a Precise switch. If the user turns it off, continue with the request for precise location. - After the user’s choice in the alert, the request completes without an error. Read the
accuracyAuthorizationproperty after it. ThepromptDeclinederror means that iOS didn’t show the alert. iOS doesn’t show it when the purpose key is missing from the dictionary, the app already has precise location, or the app is in the background.
- The iOS request needs location access while the app is in use. When the location authorization status is
- Limitations: Precise location from this request is temporary: it expires on its own, and iOS postpones the expiration while the app is in use. The alert can appear again in a later session. Precise location that the user selected in the location alert or in Settings doesn’t expire.
Camera and media
Camera
- What the user sees: An alert with your purpose string.
- Setup: Add the
NSCameraUsageDescriptionkey toInfo.plist. Without this key, a request for camera access raises an exception, and iOS terminates the app. Request the permission with theAVCaptureDevice.requestAccess(for:)method and the.videomedia type.
Pass the result that matches the camera authorization status:
| What iOS reports | Result to pass |
|---|---|
.notDetermined, then the user grants the permission | Granted, granted |
.notDetermined, then the user declines | Not granted, denied |
.denied before the request | Not granted, permanently_denied |
.restricted | Not granted, restricted |
.authorized | Granted, granted |
- Limitations: Until the user grants camera access, iOS gives the app black frames.
Microphone
- What the user sees: An alert with your purpose string.
- Setup: Add the
NSMicrophoneUsageDescriptionkey toInfo.plist. Without this key, the app exits when it tries to use the microphone. Request the permission with theAVCaptureDevice.requestAccess(for:)method and the.audiomedia type. On iOS 17 and later, you can use theAVAudioApplication.requestRecordPermission()method instead.
Pass the result that matches the microphone authorization status:
| What iOS reports | Result to pass |
|---|---|
.notDetermined, then the user grants the permission | Granted, granted |
.notDetermined, then the user declines | Not granted, denied |
.denied before the request | Not granted, permanently_denied |
.restricted | Not granted, restricted |
.authorized | Granted, granted |
- Limitations: Without the permission, recordings contain silence. The record permission of the
AVAudioApplicationclass has the values.undetermined,.granted, and.denied, with no restricted value: with this class, your app never passesrestricted.
Photos
- What the user sees: An alert where the user selects limited access, full access, or no access. Limited access opens a system picker where the user selects photos and videos.
- Setup: Add the
NSPhotoLibraryUsageDescriptionkey toInfo.plist. Request the permission with thePHPhotoLibrary.requestAuthorization(for:)method and the.readWriteaccess level. If the app only adds photos, declare theNSPhotoLibraryAddUsageDescriptionkey, and request the.addOnlyaccess level instead: add-only access has no limited state. Without a valid purpose string, the app crashes when it accesses the photo library. The olderrequestAuthorization(_:)method reports limited access as.authorized.
Pass the result that matches the photo library authorization status:
| What iOS reports | Result to pass |
|---|---|
.authorized | Granted, granted |
.limited: the user selected some photos | Granted, limited |
.notDetermined, then the user declines | Not granted, denied |
.denied before the request | Not granted, permanently_denied |
.restricted | Not granted, restricted |
- Limitations:
- For an app with limited access, once per app life cycle, iOS shows an alert where the user can update the selection of photos. To turn off this alert, set the
PHPhotoLibraryPreventAutomaticLimitedAccessAlertkey totrueinInfo.plist. - The
PHPickerViewControllerphoto picker needs no permission. App Review Guideline 5.1.1 asks apps to use such a picker instead of full access where they can. Request this permission when the app shows its own gallery.
- For an app with limited access, once per app life cycle, iOS shows an alert where the user can update the selection of photos. To turn off this alert, set the
Media library
- What the user sees: An alert that asks for access to Apple Music and the media library, with your purpose string.
- Setup: Add the
NSAppleMusicUsageDescriptionkey toInfo.plist. The app must have this key to access the media library. Request the permission with theMPMediaLibrary.requestAuthorization()method.
Pass the result that matches the media library authorization status:
| What iOS reports | Result to pass |
|---|---|
.notDetermined, then the user grants the permission | Granted, granted |
.notDetermined, then the user declines | Not granted, denied |
.denied before the request | Not granted, permanently_denied |
.restricted | Not granted, restricted |
.authorized | Granted, granted |
- Limitations: Media library and Apple Music show the same purpose string, from the
NSAppleMusicUsageDescriptionkey, and share one authorization status. After the user grants or declines one of them, a request for the other one returns that decision without an alert.
Apple Music
- What the user sees: An alert that asks for access to Apple Music and the media library, with your purpose string.
- Setup: Add the
NSAppleMusicUsageDescriptionkey toInfo.plist. Without this key, iOS terminates the app when the app accesses the user’s music. Request the permission with the MusicKitMusicAuthorization.request()method. TheSKCloudServiceController.requestAuthorization(_:)method returns the same authorization but is deprecated in iOS 18. Use it only where the app can’t call MusicKit, for example from a wrapper’s permission library.
Pass the result that matches the MusicKit authorization status:
| What iOS reports | Result to pass |
|---|---|
.notDetermined, then the user grants the permission | Granted, granted |
.notDetermined, then the user declines | Not granted, denied |
.denied before the request | Not granted, permanently_denied |
.restricted | Not granted, restricted |
.authorized | Granted, granted |
- Limitations:
- The permission covers the user’s Apple Music data. Playback of catalog content also needs an active Apple Music subscription, which the MusicKit
MusicSubscriptionstructure reports separately. - Apple Music and Media library share one authorization status. After the user grants or declines one of them, a request for the other one returns that decision without an alert. For example, after a refusal, your app returns
.denied("permanently_denied")for the other one.
- The permission covers the user’s Apple Music data. Playback of catalog content also needs an active Apple Music subscription, which the MusicKit
Speech recognition
- What the user sees: An alert with your purpose string.
- Setup: Add the
NSSpeechRecognitionUsageDescriptionkey toInfo.plist. Without this key, the app crashes when it calls theSFSpeechRecognizer.requestAuthorization(_:)method. Mark the closure that you pass to this method as@Sendable. In the Swift 6 language mode, an unmarked closure in a@MainActorclass inherits main-actor isolation. If iOS calls the closure on a queue other than the main queue, the app crashes. To recognize live audio, the app also needs theNSMicrophoneUsageDescriptionkey and the Microphone permission.
Pass the result that matches the speech recognition authorization status:
| What iOS reports | Result to pass |
|---|---|
.notDetermined, then the user grants the permission | Granted, granted |
.notDetermined, then the user declines | Not granted, denied |
.denied before the request | Not granted, permanently_denied |
.restricted | Not granted, restricted |
.authorized | Granted, granted |
- Limitations:
- The permission only covers speech recognition with the
SFSpeechRecognizerclass. SpeechAnalyzer transcriber modules don’t send audio to Apple and don’t need it. - Speech recognition of live audio needs two permissions: Microphone and Speech recognition. The flow sends one permission request at a time, so set up the two permissions in one of two ways:
- In the flow, add a Request permission action for each permission, on two screens.
- In your app code for Speech recognition, request the microphone permission first, then speech recognition, and pass one result for both.
- The permission only covers speech recognition with the
Personal data
Contacts
- What the user sees: An alert with your purpose string. On iOS 18 and later, the user can share all contacts or a selection.
- Setup: Add the
NSContactsUsageDescriptionkey toInfo.plist. Request the permission with theCNContactStore.requestAccess(for:)method and the.contactsentity type. The request only reports whether the user gave access, so read the authorization status with theCNContactStore.authorizationStatus(for:)method after it, also when it throws an error. The authorization status tells limited access from full access.
Pass the result that matches the contacts authorization status:
| What iOS reports | Result to pass |
|---|---|
.authorized | Granted, granted |
On iOS 18 and later, .limited: the user shared a selection of contacts | Granted, limited |
.notDetermined, then the user declines | Not granted, denied |
Still .notDetermined after the request, or no decision before the app’s timeout | Not granted, no argument |
.denied before the request | Not granted, permanently_denied |
.restricted | Not granted, restricted |
- Limitations:
- Limited access on iOS 18 and later takes four steps: the alert, a sheet that asks how to share, the contact picker, and a confirmation. A user can take more than 60 seconds, so the flow can send the
flow_permission_unansweredevent withon_screenin theoutcomeproperty before your app passes the result. If the user is still on the screen that sent the request, the flow runs the actions for the late result. - To add contacts to the selection after the user grants limited access, use the
ContactAccessButtonview or thecontactAccessPickerview modifier. - App Review Guideline 5.1.1 asks apps to use a system picker instead of full access to contacts where they can.
- Limited access on iOS 18 and later takes four steps: the alert, a sheet that asks how to share, the contact picker, and a confirmation. A user can take more than 60 seconds, so the flow can send the
Calendar
- What the user sees: An alert with your purpose string for full access or for adding events only.
- Setup: For full access on iOS 17 and later, add the
NSCalendarsFullAccessUsageDescriptionkey toInfo.plist. To add events only, use theNSCalendarsWriteOnlyAccessUsageDescriptionkey instead. Request the permission with theEKEventStore.requestFullAccessToEvents()orrequestWriteOnlyAccessToEvents()method. For iOS 16 and earlier, also declare theNSCalendarsUsageDescriptionkey. On these versions, request the permission with therequestAccess(to:)method and the.evententity type.
Pass the result that matches the calendar authorization status:
| What iOS reports | Result to pass |
|---|---|
.fullAccess, or .authorized on iOS 16 and earlier | Granted, granted |
On iOS 17 and later, .writeOnly, and the app requested write-only access | Granted, granted |
On iOS 17 and later, .writeOnly, and the app requested full access | Granted, limited |
.notDetermined, then the user declines | Not granted, denied |
.denied before the request | Not granted, permanently_denied |
.restricted | Not granted, restricted |
| The request throws an error | Not granted, no argument |
- Limitations:
- On iOS 17 and later, iOS denies every request from an app with only the
NSCalendarsUsageDescriptionkey, without an alert. - The value
calendardoesn’t say which access to request: your app decides. iOS has no read-only access. An app with write-only access sees one virtual calendar and no events. - To add an event without calendar access, use the
EKEventEditViewControllerview controller on iOS 17 and later.
- On iOS 17 and later, iOS denies every request from an app with only the
Reminders
- What the user sees: An alert with your purpose string.
- Setup: On iOS 17 and later, add the
NSRemindersFullAccessUsageDescriptionkey toInfo.plist. Request the permission with theEKEventStore.requestFullAccessToReminders()method. For iOS 16 and earlier, also declare theNSRemindersUsageDescriptionkey. On these versions, request the permission with therequestAccess(to:)method and the.reminderentity type. On iOS 17 and later, iOS uses theNSRemindersUsageDescriptionkey as a fallback when theNSRemindersFullAccessUsageDescriptionkey is missing.
Pass the result that matches the reminders authorization status:
| What iOS reports | Result to pass |
|---|---|
.fullAccess, or .authorized on iOS 16 and earlier | Granted, granted |
.notDetermined, then the user declines | Not granted, denied |
.denied before the request | Not granted, permanently_denied |
.restricted | Not granted, restricted |
| The request throws an error | Not granted, no argument |
- Limitations: iOS has no write-only access to reminders.
Health data
- What the user sees: The Health access sheet for the data types that the app requests.
- Setup:
- Add the HealthKit capability.
- To read health data, add the
NSHealthShareUsageDescriptionkey toInfo.plist. To write health data, add theNSHealthUpdateUsageDescriptionkey. Without these keys, the app crashes when it requests access. - Request the permission with the
HKHealthStore.requestAuthorization(toShare:read:)method. Call theHKHealthStore.isHealthDataAvailable()method first. The flow sends no data types, so the app code passes its own. Before the request, thegetRequestStatusForAuthorization(toShare:read:)method tells whether iOS will show the sheet. - When you add the HealthKit capability, Xcode adds the
healthkitentry to theUIRequiredDeviceCapabilitieskey. This entry blocks installs on devices without HealthKit. If the app works without health data, remove the entry.
Pass the result that matches the health data access:
| What iOS reports | Result to pass |
|---|---|
isHealthDataAvailable() returns false | Not granted, unsupported |
The request fails with errorHealthDataRestricted | Not granted, restricted |
| The request completes, and the app requested only read access | Not granted, no argument |
Every requested write type is .sharingAuthorized | Granted, granted |
Some requested write types are .sharingAuthorized | Granted, limited |
| No requested write type is authorized, after the sheet | Not granted, denied |
No requested write type is authorized, and getRequestStatusForAuthorization returned .unnecessary before the request: iOS showed no sheet | Not granted, permanently_denied |
| The request throws another error | Not granted, no argument |
- Limitations:
- iOS doesn’t tell the app whether the user granted read access to health data. If the user denies reading, queries return no data. For a request that only asks for read access, your app returns
.denied(nil), and the flow runs the After response actions: put the next step of the flow there. Only a request for write types reports the user’s choice. - iOS shows the sheet again when the app requests a data type for the first time. It doesn’t ask again for a type that the user granted or declined.
- iOS doesn’t tell the app whether the user granted read access to health data. If the user denies reading, queries return no data. For a request that only asks for read access, your app returns
Motion & Fitness
- What the user sees: An alert with your purpose string the first time the app accesses motion activity data.
- Setup: Add the
NSMotionUsageDescriptionkey toInfo.plist. Without this key, the app crashes when it accesses motion data. iOS has no request method: the first access to motion activity data shows the alert, and iOS reports the user’s choice to the handler of that access. Call theCMMotionActivityManager.isActivityAvailable()method first. Read the authorization status with theCMMotionActivityManager.authorizationStatus()method.
Pass the result that matches the motion authorization status:
| What iOS reports | Result to pass |
|---|---|
isActivityAvailable() returns false: the device has no motion data | Not granted, unsupported |
.notDetermined, then the user grants the permission | Granted, granted |
.notDetermined, then the user declines | Not granted, denied |
Still .notDetermined when the timeout ends | Not granted, no argument |
.denied before the request | Not granted, permanently_denied |
.restricted | Not granted, restricted |
.authorized | Granted, granted |
- How to pass the result: Wait for the query handler of the motion data access with a timeout. Then read the authorization status with the
authorizationStatus()method, and pass the result that matches it.
Device and home
Bluetooth
- What the user sees: An alert with your purpose string the first time the app creates a Bluetooth manager.
- Setup: Add the
NSBluetoothAlwaysUsageDescriptionkey toInfo.plist. Without this key, the app crashes when it uses Core Bluetooth. iOS has no request method: when the app creates aCBCentralManagerobject, iOS shows the alert and then calls thecentralManagerDidUpdateState(_:)delegate method. Read theCBManager.authorizationproperty first. Create the manager with theCBCentralManagerOptionShowPowerAlertKeyoption set tofalse, so that iOS doesn’t also ask the user to turn on Bluetooth.
Pass the result that matches the Bluetooth authorization status:
| What iOS reports | Result to pass |
|---|---|
.notDetermined, then the user grants the permission | Granted, granted |
.notDetermined, then the user declines | Not granted, denied |
Still .notDetermined when the timeout ends | Not granted, no argument |
.denied before the request | Not granted, permanently_denied |
.restricted | Not granted, restricted |
.allowedAlways | Granted, granted |
- How to pass the result:
- Wait for the
centralManagerDidUpdateState(_:)delegate method with a timeout. Then pass the result that matches theCBManager.authorizationproperty. - A Bluetooth adapter that is turned off isn’t a refusal. Pass the result that matches the permission, not the adapter state.
- Wait for the
Local network
- What the user sees: An alert with your purpose string the first time the app accesses the local network.
- Setup: Add the
NSLocalNetworkUsageDescriptionkey toInfo.plist. For each Bonjour service type that the app browses or advertises, add an entry such as_myservice._tcpto theNSBonjourServiceskey. Multicast and broadcast also need thecom.apple.developer.networking.multicastentitlement, which Apple must approve. iOS has no request method and no authorization status API. A local network operation shows the alert, such as a Bonjour browse or a connection to a device on the network.
Pass the result that matches the outcome of a local network operation:
| What iOS reports | Result to pass |
|---|---|
| An outgoing operation that needs local network access succeeds, such as a Bonjour browse or an outgoing TCP connection | Granted, granted |
| The operation fails, or gets no result before the app’s timeout | Not granted, no argument |
| The app has no local network feature | Not granted, unsupported |
- How to pass the result: Keep the timeout short, such as 20 seconds. Never wait 60 seconds or more: at 60 seconds without a result, the flow reports the
flow_permission_unansweredevent. - Limitations:
- Your app learns nothing when the user declines. The flow stays on the screen until your app’s timeout expires, then runs the After response actions, with
no_statusin theoutcomeproperty. For this permission, the flow never runs the When denied actions. - iOS doesn’t report the local network authorization status. iOS can deny the operation that shows the alert before the user’s choice, so a failed operation doesn’t mean a refusal. Put the next step of the flow in After response.
- In the background, iOS denies a local network operation without an alert and doesn’t store the result. The alert appears at the next operation in the foreground.
- The iOS Simulator doesn’t apply local network privacy. Test on a device.
- Your app learns nothing when the user declines. The flow stays on the screen until your app’s timeout expires, then runs the After response actions, with
HomeKit
- What the user sees: An alert with your purpose string the first time the app uses HomeKit.
- Setup: Add the HomeKit capability, and add the
NSHomeKitUsageDescriptionkey toInfo.plist. Without the key, the app crashes the first time it uses HomeKit. iOS has no request method: when the app creates anHMHomeManagerobject, iOS shows the alert. iOS reports the authorization status to thehomeManager(_:didUpdate:)delegate method, and theHMHomeManager.authorizationStatusproperty returns it. Keep oneHMHomeManagerobject for the life of the app.
The HomeKit authorization status is a set of flags. Pass the result that matches the flags:
| What iOS reports | Result to pass |
|---|---|
.authorized is set | Granted, granted |
.determined without .authorized, after the alert | Not granted, denied |
.determined without .authorized, before the request | Not granted, permanently_denied |
.determined isn’t set when the timeout ends | Not granted, no argument |
- How to pass the result: After a refusal in an earlier launch, iOS calls no delegate method: a new
HMHomeManagerobject already has the decided authorization status. Read theauthorizationStatusproperty right after you create the manager, and again while you wait for the user’s choice, with a timeout. Apple defines the.restrictedflag as “The app doesn’t have access to home data”, not as a device policy, so don’t passrestrictedfor it.
Focus status
- What the user sees: An alert with your purpose string that asks to share the Focus status.
- Setup: Add the
NSFocusStatusUsageDescriptionkey toInfo.plistbefore the app uses theINFocusStatusCenterclass. Request the permission with theINFocusStatusCenter.default.requestAuthorization()method. To read the Focus status after the user grants the permission, the app also needs notification authorization and the Communication Notifications capability.
Pass the result that matches the Focus status authorization status:
| What iOS reports | Result to pass |
|---|---|
.notDetermined, then the user grants the permission | Granted, granted |
.notDetermined, then the user declines | Not granted, denied |
.notDetermined after the request: the user selected neither | Not granted, no argument |
.denied before the request | Not granted, permanently_denied |
.restricted | Not granted, restricted |
.authorized | Granted, granted |
Siri
- What the user sees: An alert with your purpose string that asks to use Siri with the app.
- Setup: Add the Siri capability, and add the
NSSiriUsageDescriptionkey toInfo.plist. Request the permission with theINPreferences.requestSiriAuthorization(_:)method. Mark the closure that you pass to this method as@Sendable. In the Swift 6 language mode, an unmarked closure in a@MainActorclass inherits main-actor isolation. If iOS calls the closure on a queue other than the main queue, the app crashes. Apple requires the Siri capability for the authorization to succeed. In an app without the capability, every call to theINPreferencesclass raises an exception, including a call to thesiriAuthorizationStatus()method, and the app crashes. There, return.denied("unsupported")without a call to theINPreferencesclass.
Pass the result that matches the Siri authorization status:
| What iOS reports | Result to pass |
|---|---|
.notDetermined, then the user grants the permission | Granted, granted |
.notDetermined, then the user declines | Not granted, denied |
.denied before the request | Not granted, permanently_denied |
.restricted | Not granted, restricted |
.authorized | Granted, granted |
- Limitations:
- An app that only supports actions in the Shortcuts app doesn’t need this permission.
- Siri or Maps can ask the user for this permission on the app’s behalf, the first time the user uses one of the app’s intents. The user can then decide before the flow sends the request.