参考一:app
最近升级了Xcode8.0,真是不少坑啊,填完一个来另一个,今天又遇到了一个,用Xcode8.0上传项目时被驳回说是info.plist里面没有设置NSPhotoLibraryUsageDescription、NSCameraUsageDescription、NSContactsUsageDescription、NSMicrophoneUsageDescription等字段,以前这些都是预设的不用加,如今强制了,真是郁闷,下面贴上解决方案this
被驳回的缘由:.net
This app attempts 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.code
This app attempts to access privacy-sensitive data without a usage description. The app’s Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.cdn
大概意思就是得在plist里面必须加上NSPhotoLibraryUsageDescription和NSCameraUsageDescription的键值对才行,以前都是默认的,如今必须加,要不不让经过,真是坑啊~~具体配置以下图:blog
大概统计了一下须要加的一些字段列在下面:图片
NSContactsUsageDescription -> 通信录ip
NSMicrophoneUsageDescription -> 麦克风字符串
NSPhotoLibraryUsageDescription -> 相册get
NSCameraUsageDescription -> 相机
NSLocationAlwaysUsageDescription -> 地理位置
NSLocationWhenInUseUsageDescription -> 地理位置
Privacy - Bluetooth Peripheral Usage Description -> 蓝牙权限
Privacy - Speech Recognition Usage Description -> 语音转文字权限
Privacy - Calendars Usage Description -> 日历权限
Privacy - Contacts Usage Description -> 通信录权限
大概就是以上的一些字段,写一篇博客总结一下,方便之后用到的时候能找到,若是你们有补充的能够告诉我一下,谢谢你们的阅读
参考二
解决办法(fix method):
在info.plist —Source Code中添加
UsageDescription相关的key, 描述字符串本身随意填写就能够,可是必定要填写,否则会引起包无效的问题,致使上传打包后构建版本一直不显示。
<!-- 相册 --> <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>
iOS 10 开始对隐私权限更加严格, 如需使用隐私权限须要在工程的info.plist文件中声明,若是不声明程序在调用隐私权限(如相机)时应用程序会崩溃
离线打包用户须要手动添加权限到打包工程的info.plist文件中
key可从如下表中获取,value为弹框提示文字用户可随意添加,类型String
权限名称 | Key值 |
---|---|
通信录 | NSContactsUsageDescription |
麦克风 | NSMicrophoneUsageDescription |
相册 | NSPhotoLibraryUsageDescription |
相机 | NSCameraUsageDescription |
持续获取地理位置 | NSLocationAlwaysUsageDescription |
使用时获取地理位置 | NSLocationWhenInUseUsageDescription |
蓝牙 | NSBluetoothPeripheralUsageDescription |
语音转文字 | NSSpeechRecognitionUsageDescription |
日历 | NSCalendarsUsageDescription |
参考资料
http://blog.csdn.net/wang631106979/article/details/52578001
http://blog.csdn.net/qq_30513483/article/details/52587483
http://blog.csdn.net/dcw050505/article/details/53038798
http://ask.dcloud.net.cn/article/931