<key>NSPhotoLibraryUsageDescription</key>
<string>Photo Library Access Warning</string>
编辑:
我在我的应用程序的不同组件上也遇到了类似的问题。在更新到Xcode8/iOS10后,到目前为止已添加了所有这些键:
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app does not require access to the microphone.</string>
<key>NSCameraUsageDescription</key>
<string>This app requires access to the camera.</string>
查看此developer.apple.com链接,获取属性列表关键引用的完整列表。
完整列表:
Apple Music:
<key>NSAppleMusicUsageDescription</key>
<string>My description about why I need this capability</string>
蓝牙:
<key>NSBluetoothPeripheralUsageDescription</key>
<string>My description about why I need this capability</string>
日历:
<key>NSCalendarsUsageDescription</key>
<string>My description about why I need this capability</string>
相机:
<key>NSCameraUsageDescription</key>
<string>My description about why I need this capability</string>
联系人:
<key>NSContactsUsageDescription</key>
<string>My description about why I need this capability</string>
面部识别:
<key>NSFaceIDUsageDescription</key>
<string>My description about why I need this capability</string>
健康分享:
<key>NSHealthShareUsageDescription</key>
<string>My description about why I need this capability</string>
健康更新:
<key>NSHealthUpdateUsageDescription</key>
<string>My description about why I need this capability</string>
家庭套件:
<key>NSHomeKitUsageDescription</key>
<string>My description about why I need this capability</string>
位置:
<key>NSLocationUsageDescription</key>
<string>My description about why I need this capability</string>
位置(始终):
<key>NSLocationAlwaysUsageDescription</key>
<string>My description about why I need this capability</string>
使用中的位置:
<key>NSLocationWhenInUseUsageDescription</key>
<string>My description about why I need this capability</string>
麦克风:
<key>NSMicrophoneUsageDescription</key>
<string>My description about why I need this capability</string>
动作(加速计):
<key>NSMotionUsageDescription</key>
<string>My description about why I need this capability</string>
NFC(近场通信):
<key>NFCReaderUsageDescription</key>
<string>My description about why I need this capability</string>
照片库:
<key>NSPhotoLibraryUsageDescription</key>
<string>My description about why I need this capability</string>
照片库(仅写入访问权限):
<key>NSPhotoLibraryAddUsageDescription</key>
<string>My description about why I need this capability</string>
提醒:
<key>NSRemindersUsageDescription</key>
<string>My description about why I need this capability</string>
Siri:
<key>NSSiriUsageDescription</key>
<string>My description about why I need this capability</string>
语音识别:
<key>NSSpeechRecognitionUsageDescription</key>
<string>My description about why I need this capability</string>
截止至2021年8月,我们不仅需要添加以下内容:
<key>NSPhotoLibraryUsageDescription</key>
<string>We need access to photo library so that photos can be selected</string>
但是还需要将此添加到iOS文件夹内的info.plist文件中才能正常工作
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app requires access to the photo library.</string>
你需要将这两个粘贴到你的info.plist文件中,在iOS 11中这是唯一对我有效的方法。
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app requires access to the photo library.</string>
要访问摄像头,请使用以下方法:
<key>NSCameraUsageDescription</key>
<string>Camera Access Warning</string>
NSCameraUsageDescription
时,用户可以访问相机并从照片库中选择图片。因此,我不需要NSPhotoLibraryUsageDescription
,对吗?<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app requires read and write permission from the user.</string>
if you're adding it from the generic editor then "Privacy - Photo Library Additions Usage Description" will be the given option you will find out instead of "NSPhotoLibraryAddUsageDescription".