gpt4 book ai didi

ios - NSPhotoLibraryUsageDescription key 必须存在于 Info.plist 中才能使用相机胶卷

转载 作者:IT王子 更新时间:2023-10-29 07:27:11 32 4
gpt4 key购买 nike

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

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

我正在使用 React Native 构建我的应用程序(我不熟悉 ios 原生开发),我不知道如何将此 key 添加到 Info.plist

你能举个例子吗?谢谢

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

enter image description here

最佳答案

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

<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属性列表关键引用的完整列表链接。

完整列表:

苹果音乐:

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

关于ios - NSPhotoLibraryUsageDescription key 必须存在于 Info.plist 中才能使用相机胶卷,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39519773/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com