美文网首页
Missing info.plist key -- Re

Missing info.plist key -- Re

作者: 这波能反杀 | 来源:发表于2018-06-27 14:26 被阅读347次

React Native真的是坑巨多无比。只能一边抹泪踩坑,一边默默收集。

在Xcode提交构建版本成功之后,但是iTunes Connect时构建版本状态为“正在处理”,然后刷新构建版本就消失了。纠结了很久,才偶然发现apple官方已经往开发者账户的邮箱里发送了邮件说明了原因。

image.png
This app has crashed because it attempted to access 
privacy-sensitive data without a usage description.
The app's Info.plist must contain 
an NSPhotoLibraryUsageDescription key with a string value 
explaining to the user how the app uses this data.

大概意思就是说我们需要在info.plist中添加一个键值对,key值为NSPhotoLibraryUsageDescription,而value则随意。

NSPhotoLibraryUsageDescription是我们在调用原生的相册组件需要配置的一个权限键值。

从邮件中可以看出,我还需要分别配置

NSCalendarsUsageDescription 日历权限
NSBluetoothPeripheralUsageDescription 蓝牙权限
NSAppleMusicUsageDescription 媒体资源库权限
NSMotionUsageDescription 运动健身权限
NSSpeechRecognitionUsageDescription 语音识别权限

从网上收集了一些可能会涉及到的权限说明,大概如下

<!-- 相册 --> 
<key>NSPhotoLibraryUsageDescription</key> 
<string>App需要您的同意,才能访问相册</string> 
<!-- 相机 --> 
<key>NSCameraUsageDescription</key> 
<string>App需要您的同意,才能访问相机</string> 
<!-- 麦克风 --> 
<key>NSMicrophoneUsageDescription</key> 
<string>App需要您的同意,才能访问麦克风</string> 
<!-- 位置 --> 
<key>NSLocationUsageDescription</key> 
<string>App需要您的同意,才能访问位置</string> 
<!-- 在使用期间访问位置 --> 
<key>NSLocationWhenInUseUsageDescription</key> 
<string>App需要您的同意,才能在使用期间访问位置</string> 
<!-- 始终访问位置 --> 
<key>NSLocationAlwaysUsageDescription</key> 
<string>App需要您的同意,才能始终访问位置</string> 
<!-- 日历 --> 
<key>NSCalendarsUsageDescription</key> 
<string>App需要您的同意,才能访问日历</string> 
<!-- 提醒事项 --> 
<key>NSRemindersUsageDescription</key> 
<string>App需要您的同意,才能访问提醒事项</string> 
<!-- 运动与健身 --> 
<key>NSMotionUsageDescription</key>
<string>App需要您的同意,才能访问运动与健身</string> 
<!-- 健康更新 --> 
<key>NSHealthUpdateUsageDescription</key> 
<string>App需要您的同意,才能访问健康更新 </string> 
<!-- 健康分享 --> 
<key>NSHealthShareUsageDescription</key> 
<string>App需要您的同意,才能访问健康分享</string> 
<!-- 蓝牙 --> 
<key>NSBluetoothPeripheralUsageDescription</key> 
<string>App需要您的同意,才能访问蓝牙</string> 
<!-- 媒体资料库 --> 
<key>NSAppleMusicUsageDescription</key> 
<string>App需要您的同意,才能访问媒体资料库</string>

配置好后,重新打包上传到app store即可。

新的邮件通知

参考资料:

https://www.jianshu.com/p/90d5323cf510
https://stackoverflow.com/questions/39519773/nsphotolibraryusagedescription-key-must-be-present-in-info-plist-to-use-camera-r

相关文章

网友评论

      本文标题:Missing info.plist key -- Re

      本文链接:https://www.haomeiwen.com/subject/okvbyftx.html