最近,我开始收到以下错误:
NSPhotoLibraryUsageDescription键必须存在于Info.plist中才能使用相机卷。
我正在使用RAPNative来构建我的应用程序(我不熟悉ios本机开发),我不知道如何将这个键添加到Info.plist中
你能举个例子吗?谢谢
我正在使用npm软件包"react-native-camera-roll-picker": "^1.1.7"
发布于 2016-09-15 20:37:14
谢谢@rmaddy,我在Info.plist中的其他键串对之后添加了这个选项,并修复了这个问题:
<key>NSPhotoLibraryUsageDescription</key>
<string>Photo Library Access Warning</string>
编辑:
在我的应用程序的不同组件上,我也遇到了类似的问题。到目前为止,添加了所有这些键(在更新到Xcode8 8/iOS10 10之后):
<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链接以获取属性列表键引用的完整列表。
完整列表:
苹果音乐:
<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>
FaceID:
<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>
近场通信:
<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>
发布于 2017-02-18 10:06:33
我最喜欢的方法
开放info.plist
1. 开放
2.单击此按钮添加一个新的键
3.向下滚动以查找隐私-照片库使用说明
4.选择它,然后在右边的上添加您的描述
发布于 2017-03-06 12:43:21
在info.plist文件中添加以下代码
<key>NSPhotoLibraryUsageDescription</key>
<string>My description about why I need this capability</string>
https://stackoverflow.com/questions/39519773
复制相似问题