NSPhotoLibraryUsageDescription 键必须存在于 Info.plist 中才能使用相机胶卷 [英] NSPhotoLibraryUsageDescription key must be present in Info.plist to use camera roll

查看:47
本文介绍了NSPhotoLibraryUsageDescription 键必须存在于 Info.plist 中才能使用相机胶卷的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我开始收到这个错误:

Recently I started to get this error:

NSPhotoLibraryUsageDescription 键必须存在于 Info.plist 中使用相机胶卷.

NSPhotoLibraryUsageDescription key must be present in Info.plist to use camera roll.

我正在使用 React Native 来构建我的应用程序(我不熟悉 ios 原生开发)并且我不知道如何将这个键添加到 Info.plist

I am using React Native to build my app (I am not familiar with ios native development) and I don't know how to add this key to Info.plist

你能举个例子吗?谢谢

我正在使用 npm 包 "react-native-camera-roll-picker": "^1.1.7"

I am using npm package "react-native-camera-roll-picker": "^1.1.7"

推荐答案

谢谢@rmaddy,我在 Info.plist 中的其他键字符串对之后添加了这个并解决了问题:

Thanks @rmaddy, I added this just after other key-string pairs in Info.plist and fixed the problem:

<key>NSPhotoLibraryUsageDescription</key>
<string>Photo Library Access Warning</string>

我的应用程序的不同组件最终也遇到了类似的问题.到目前为止,最终添加了所有这些键(更新到 Xcode8/iOS10 后):

I also ended up having similar problems on different components of my app. Ended up adding all these keys so far (after updating to 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 属性列表关键引用的完整列表链接.

Checkout this developer.apple.com link for full list of property list key references.

完整列表:

苹果音乐:

<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>

照片库(只写访问权限):

Photo Library (Write-only access):

<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>

这篇关于NSPhotoLibraryUsageDescription 键必须存在于 Info.plist 中才能使用相机胶卷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆