Changes in Permission Requests from iOS 10 Onwards: A Comprehensive Guide to Info.plist Privacy Keys and Best Practices

Dec 05, 2025 · Programming · 10 views · 7.8

Keywords: iOS permissions | Info.plist | privacy keys | app crash | best practices

Abstract: This article delves into the changes in app permission request mechanisms since iOS 10, focusing on the necessity of privacy keys in Info.plist. It provides a detailed list of updated privacy keys as of iOS 13, including NSCameraUsageDescription and NSPhotoLibraryUsageDescription, and explains why missing these keys can cause app crashes. By analyzing official documentation and real-world cases, the article outlines steps for adding these keys, offers sample code, and highlights the importance of detailed and accurate description text for app review. Additionally, it discusses the NSPhotoLibraryAddUsageDescription key introduced in iOS 11 and summarizes best practices for developers to avoid common pitfalls and enhance user experience.

Introduction

With the release of iOS 10, Apple introduced stricter privacy protections, requiring apps to add specific privacy keys and provide clear description text in the Info.plist file before accessing hardware features (e.g., camera, microphone) or user data (e.g., photo library, contacts). This change aims to enhance user control over data usage, but if developers fail to configure it correctly, the app may crash at runtime. Based on high-scoring answers from Stack Overflow and official documentation, this article systematically analyzes the core concepts of this mechanism and offers practical guidance.

Background of Permission Request Changes in iOS 10

Prior to iOS 10, apps already needed to request permissions for sensitive resources, such as camera and microphone access in iOS 6 and 7. However, iOS 10 tightened this requirement: if the Info.plist lacks necessary privacy keys or the description text is empty, the app will crash immediately. This change reflects Apple's emphasis on user privacy, forcing developers to explicitly state the purpose of data usage. For example, accessing the photo library requires adding the NSPhotoLibraryUsageDescription key with a description like "${PRODUCT_NAME} needs access to your photo library to select a profile picture." This mechanism not only increases transparency but also reduces the risk of malicious apps abusing permissions.

Complete List and Updates of Privacy Keys

According to Apple's official documentation and community updates, as of iOS 13, the list of privacy keys has expanded. Below is a comprehensive list; developers should add keys selectively based on app functionality:

NFCReaderUsageDescription
NSAppleMusicUsageDescription
NSBluetoothAlwaysUsageDescription
NSBluetoothPeripheralUsageDescription
NSCalendarsUsageDescription
NSCameraUsageDescription
NSContactsUsageDescription
NSFaceIDUsageDescription
NSHealthShareUsageDescription
NSHealthUpdateUsageDescription
NSHomeKitUsageDescription
NSLocationAlwaysUsageDescription
NSLocationUsageDescription
NSLocationWhenInUseUsageDescription
NSMicrophoneUsageDescription
NSMotionUsageDescription
NSPhotoLibraryAddUsageDescription
NSPhotoLibraryUsageDescription
NSRemindersUsageDescription
NSSiriUsageDescription
NSSpeechRecognitionUsageDescription
NSVideoSubscriberAccountUsageDescription

Each key corresponds to a specific permission request scenario. For instance, NSCameraUsageDescription is for camera access, while NSPhotoLibraryAddUsageDescription, introduced in iOS 11, is for adding content to the photo library. Developers should refer to Apple's Cocoa Keys documentation to ensure compatibility.

How to Add Privacy Keys to Info.plist

There are two main methods to add privacy keys: via the Xcode interface or by directly editing the Info.plist source file. In Xcode, navigate to Target -> Info -> Custom iOS Target Properties, click "+" to add a new key, and enter the key name (e.g., NSCameraUsageDescription) and description text. For example:

<key>NSCameraUsageDescription</key>
<string>${PRODUCT_NAME} needs to use the camera to take photos for updating your profile avatar</string>

If editing as a source file, ensure correct XML formatting. The description text should be specific and user-friendly, avoiding vague statements. Community reports indicate that Apple may reject apps during review for ambiguous descriptions, so it is recommended to detail the purpose, such as changing "needs camera access" to "needs camera access to scan QR codes."

Real-World Cases and Considerations

From developer experiences, neglecting privacy key configuration is a common mistake. For example, an app crashed during audio recording due to missing NSMicrophoneUsageDescription. Moreover, the quality of description text is crucial: cases show apps being rejected by the App Store for overly generic descriptions (e.g., "needs camera permission"). Apple advises that descriptions should clearly state data usage, such as "${PRODUCT_NAME} uses the camera for video calls," which helps users understand and grant permission. For iOS 11 and later, if an app needs to write to the photo library, the NSPhotoLibraryAddUsageDescription key must be added; otherwise, functionality may be impaired.

Summary of Best Practices

To effectively manage permission requests, developers should follow these best practices: First, identify required permissions early in development and pre-configure all relevant keys in Info.plist. Second, write detailed and specific description text, avoiding placeholders or generic phrases. Third, regularly check Apple documentation for updates, as privacy keys may change with iOS versions. Fourth, test by simulating permission denial scenarios to ensure the app handles them gracefully. Finally, consider user experience by requesting permissions only when necessary and providing contextual explanations. These steps not only prevent crashes but also enhance app credibility and user satisfaction.

Conclusion

The permission request mechanism in iOS 10 and later represents a significant advancement in Apple's privacy protection efforts. By mandating the addition of privacy keys and descriptions in Info.plist, developers must transparentize data usage, thereby reducing abuse risks. This article systematically outlines the list of privacy keys, addition methods, and considerations, emphasizing the importance of detailed descriptions. As the iOS ecosystem evolves, developers should stay informed about related changes to ensure app compatibility and user trust. Proper implementation of these practices will contribute to building safer and more user-friendly iOS applications.

Copyright Notice: All rights in this article are reserved by the operators of DevGex. Reasonable sharing and citation are welcome; any reproduction, excerpting, or re-publication without prior permission is prohibited.