[已更新隐私密钥列表至iOS 13-请参见下文]
以下是您可以在Info.plist
文件中指定的所有Cocoa Keys
列表:
https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html
(Xcode:Target -> Info -> Custom iOS Target Properties)
iOS早期版本(iOS 6,iOS 7)就已经要求访问麦克风、相机和媒体库的权限,但自从iOS 10以来,如果您不提供请求权限的描述(它不能是空的),则应用程序会崩溃。
带示例描述的隐私密钥:
![cheatsheet](https://istack.dev59.com/aY8RG.webp)
来源
或者,您可以将 Info.plist
文件以源代码形式打开:
![source code](https://tisunov.github.io/assets/map-address-picker/info-plist-as-source-code.png)
来源
并像这样添加隐私密钥:
<key>NSLocationAlwaysUsageDescription</key>
<string>${PRODUCT_NAME} always location use</string>
所有隐私密钥列表:[已更新至iOS 13]
NFCReaderUsageDescription
NSAppleMusicUsageDescription
NSBluetoothAlwaysUsageDescription
NSBluetoothPeripheralUsageDescription
NSCalendarsUsageDescription
NSCameraUsageDescription
NSContactsUsageDescription
NSFaceIDUsageDescription
NSHealthShareUsageDescription
NSHealthUpdateUsageDescription
NSHomeKitUsageDescription
NSLocationAlwaysUsageDescription
NSLocationUsageDescription
NSLocationWhenInUseUsageDescription
NSMicrophoneUsageDescription
NSMotionUsageDescription
NSPhotoLibraryAddUsageDescription
NSPhotoLibraryUsageDescription
NSRemindersUsageDescription
NSSiriUsageDescription
NSSpeechRecognitionUsageDescription
NSVideoSubscriberAccountUsageDescription
2019年更新:
在过去几个月中,我的两个应用程序在审核期间被拒绝,因为相机使用说明没有明确说明我拍摄的照片用于何种用途。
尽管应用场景明显(用户点击了头像),但我不得不把描述从${PRODUCT_NAME}需要访问相机来拍摄照片
更改为${PRODUCT_NAME}需要访问相机来更新您的头像
。
看起来苹果现在更加关注隐私使用说明,我们应该详细解释为什么要请求权限。