Protected Resources

Control an app’s access to protected system services and user data.

Overview

Before your app can access certain protected resources, like the Bluetooth interface, location information, or the user’s photos, the system asks the user for permission on behalf of your app. To signal that your app needs the access, you add a UsageDescription key to your app’s Information Property List. You set the value associated with the key to a string that explains why your app needs access. The system displays this string when prompting the user, as described in Accessing Protected Resources.

Topics

Essentials

Accessing Protected Resources

Request user permission to access restricted resources by providing a purpose string that explains why you need the access.

Bluetooth

property list key NSBluetoothAlwaysUsageDescription

A message that tells the user why the app needs access to Bluetooth.

Name: Privacy - Bluetooth Always Usage Description
property list key NSBluetoothPeripheralUsageDescription

A message that tells the user why the app is requesting the ability to connect to Bluetooth peripherals.

Name: Privacy - Bluetooth Peripheral Usage Description
Deprecated

Calendar and Reminders

Accessing the Event Store

Request access to a user's calendar data through the event store.

property list key NSCalendarsUsageDescription

A message that tells the user why the app is requesting access to the user’s calendar data.

Name: Privacy - Calendars Usage Description
property list key NSRemindersUsageDescription

A message that tells the user why the app is requesting access to the user’s reminders.

Name: Privacy - Reminders Usage Description

Camera and Microphone

Requesting Authorization for Media Capture on iOS

Respect user privacy by seeking permission to capture and store photos, audio, and video.

Requesting Authorization for Media Capture on macOS

Prompt the user to authorize access to the camera and microphone.

property list key NSCameraUsageDescription

A message that tells the user why the app is requesting access to the device’s camera.

Name: Privacy - Camera Usage Description
property list key NSMicrophoneUsageDescription

A message that tells the user why the app is requesting access to the device’s microphone.

Name: Privacy - Microphone Usage Description

Contacts

property list key NSContactsUsageDescription

A message that tells the user why the app is requesting access to the user’s contacts.

Name: Privacy - Contacts Usage Description

Face ID

Logging a User into Your App with Face ID or Touch ID

Supplement your own authentication scheme with biometric authentication, making it easy for users to access sensitive parts of your app.

property list key NSFaceIDUsageDescription

A message that tells the user why the app is requesting the ability to authenticate with Face ID.

Name: Privacy - Face ID Usage Description

Files and Folders

property list key NSDesktopFolderUsageDescription

A message that tells the user why the app needs access to the user’s Desktop folder.

Name: Privacy - Desktop Folder Usage Description
property list key NSDocumentsFolderUsageDescription

A message that tells the user why the app needs access to the user’s Documents folder.

Name: Privacy - Documents Folder Usage Description
property list key NSDownloadsFolderUsageDescription

A message that tells the user why the app needs access to the user’s Downloads folder.

Name: Privacy - Downloads Folder Usage Description
property list key NSNetworkVolumesUsageDescription

A message that tells the user why the app needs access to files on a network volume.

Name: Privacy - Network Volumes Usage Description
property list key NSRemovableVolumesUsageDescription

A message that tells the user why the app needs access to files on a removable volume.

Name: Privacy - Removable Volumes Usage Description
property list key NSFileProviderPresenceUsageDescription

A message that tells the user why the app needs to be informed when other apps access files that it manages.

Name: Privacy - File Provider Presence Usage Description
property list key NSFileProviderDomainUsageDescription

A message that tells the user why the app needs access to files managed by a file provider.

Name: Privacy - Access to a File Provider Domain Usage Description

Health

Setting Up HealthKit

Set up and configure your HealthKit store.

property list key NSHealthClinicalHealthRecordsShareUsageDescription

A message to the user that explains why the app requested permission to read clinical records.

Name: Privacy - Health Records Usage Description
property list key NSHealthShareUsageDescription

A message to the user that explains why the app requested permission to read samples from the HealthKit store.

Name: Privacy - Health Share Usage Description
property list key NSHealthUpdateUsageDescription

A message to the user that explains why the app requested permission to save samples to the HealthKit store.

Name: Privacy - Health Update Usage Description
property list key NSHealthRequiredReadAuthorizationTypeIdentifiers

The clinical record data types that your app must get permission to read.

Home

Enabling HomeKit in Your App

Declare your app’s intention to use HomeKit, and get permission from the user to access home automation accessories.

property list key NSHomeKitUsageDescription

A message that tells the user why the app is requesting access to the user’s HomeKit configuration data.

Name: Privacy - HomeKit Usage Description

Location

Choosing the Location Services Authorization to Request

Determine the authorization your app needs to access location data.

property list key NSLocationAlwaysAndWhenInUseUsageDescription

A message that tells the user why the app is requesting access to the user’s location information at all times.

Name: Privacy - Location Always and When In Use Usage Description
property list key NSLocationUsageDescription

A message that tells the user why the app is requesting access to the user’s location information.

Name: Privacy - Location Usage Description
property list key NSLocationWhenInUseUsageDescription

A message that tells the user why the app is requesting access to the user’s location information while the app is running in the foreground.

Name: Privacy - Location When In Use Usage Description
property list key NSLocationAlwaysUsageDescription

A message that tells the user why the app is requesting access to the user's location at all times.

Name: Privacy - Location Always Usage Description
Deprecated

MediaPlayer

property list key NSAppleMusicUsageDescription

A message that tells the user why the app is requesting access to the user’s media library.

Name: Privacy - Media Library Usage Description

Motion

property list key NSMotionUsageDescription

A message that tells the user why the app is requesting access to the device’s accelerometer.

Name: Privacy - Motion Usage Description

NFC

property list key NFCReaderUsageDescription

A message that tells the user why the app is requesting access to the device’s NFC hardware.

Name: Privacy - NFC Scan Usage Description

Photos

Requesting Authorization to Access Photos

Prepare your app to ask for permission when accessing the user's photo library.

property list key NSPhotoLibraryAddUsageDescription

A message that tells the user why the app is requesting write-only access to the user’s photo library.

Name: Privacy - Photo Library Additions Usage Description
property list key NSPhotoLibraryUsageDescription

A message that tells the user why the app is requesting access to the user’s photo library.

Name: Privacy - Photo Library Usage Description

Scripting

property list key NSAppleScriptEnabled

A Boolean value indicating whether AppleScript is enabled.

Name: Scriptable

Security

property list key NSAppleEventsUsageDescription

A message that tells the user why the app is requesting the ability to send Apple events.

Name: Privacy - AppleEvents Sending Usage Description
property list key NSSystemAdministrationUsageDescription

A message in macOS that tells the user why the app is requesting to manipulate the system configuration.

Name: Privacy - System Administration Usage Description
property list key ITSAppUsesNonExemptEncryption

A Boolean value indicating whether the app uses encryption.

Name: App Uses Non-Exempt Encryption
property list key ITSEncryptionExportComplianceCode

The export compliance code provided by App Store Connect for apps that require it.

Name: App Encryption Export Compliance Code

Siri

Requesting Authorization to Use SiriKit

Request permission from the user so that Siri and Maps can communicate with your Intents app extension.

property list key NSSiriUsageDescription

A message that tells the user why the app is requesting to send user data to Siri.

Name: Privacy - Siri Usage Description

Speech

Asking Permission to Use Speech Recognition

Ask the user’s permission to perform speech recognition using Apple’s servers.

property list key NSSpeechRecognitionUsageDescription

A message that tells the user why the app is requesting to send user data to Apple’s speech recognition servers.

Name: Privacy - Speech Recognition Usage Description

TV

property list key NSVideoSubscriberAccountUsageDescription

A message that tells the user why the app is requesting access to the user’s TV provider account.

Name: Privacy - Video Subscriber Account Usage Description

Wi-Fi

property list key UIRequiresPersistentWiFi

A Boolean value indicating whether the app requires a Wi-Fi connection.

Name: Application uses Wi-Fi

See Also

Services

Data and Storage

Regulate documents, URLs, and other kinds of data movement and storage.

App Services

Configure services provided by the app, like support for giving directions or using game controllers.