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. The prompt that the system displays includes a UsageDescription string you provide, explaining why your app needs to access the protected resource. Enter the string in the Signing and Capabilities editor for your app’s target, as described in Requesting access to protected resources. Xcode adds the string as the value for the relevant Information Property List key in your app’s build settings. The topics below list the keys you use to provide usage-description strings for protected resources.
Topics
Essentials
Bluetooth
Calendar and reminders
NSCalendarsFullAccessUsageDescriptionNSCalendarsWriteOnlyAccessUsageDescriptionNSRemindersFullAccessUsageDescriptionAccessing the event store
Camera and sound
Requesting authorization to capture and save mediaRequesting Authorization for Media Capture on macOSNSAudioCaptureUsageDescriptionNSCameraUsageDescriptionNSMainCameraUsageDescriptionNSMicrophoneUsageDescription
Contacts
Face ID
Files and folders
NSDesktopFolderUsageDescriptionNSDocumentsFolderUsageDescriptionNSDownloadsFolderUsageDescriptionNSNetworkVolumesUsageDescriptionNSRemovableVolumesUsageDescriptionNSFileProviderDomainUsageDescription
Game Center
Health
Setting up HealthKitNSHealthClinicalHealthRecordsShareUsageDescriptionNSHealthShareUsageDescriptionNSHealthUpdateUsageDescriptionNSHealthRequiredReadAuthorizationTypeIdentifiers
Home
Location
Choosing the Location Services Authorization to RequestNSLocationAlwaysAndWhenInUseUsageDescriptionNSLocationUsageDescriptionNSLocationWhenInUseUsageDescriptionNSLocationTemporaryUsageDescriptionDictionaryNSLocationAlwaysUsageDescriptionNSWidgetWantsLocationNSLocationDefaultAccuracyReduced
MediaPlayer
Messages
Motion
Networking
NSLocalNetworkUsageDescriptionNSNearbyInteractionUsageDescriptionNSNearbyInteractionAllowOnceUsageDescription
NFC
Photos
Delivering an Enhanced Privacy Experience in Your Photos AppNSPhotoLibraryAddUsageDescriptionNSPhotoLibraryUsageDescription
Scripting
Security
NSUpdateSecurityPolicyNSAppDataUsageDescriptionNSUserTrackingUsageDescriptionNSAppleEventsUsageDescriptionNSSystemAdministrationUsageDescriptionITSAppUsesNonExemptEncryptionITSEncryptionExportComplianceCode