美文网首页收藏问题
xcode8 iOS10上关于NSPhotoLibraryUsa

xcode8 iOS10上关于NSPhotoLibraryUsa

作者: 小小程序媛之路 | 来源:发表于2017-02-14 16:49 被阅读38次
iOS 10出来之后,真是很多坑啊,填完一个又来一个,今天又遇到了一个,用Xcode8.0上传项目时被驳回说是info.plist里面没有设置NSPhotoLibraryUsageDescription、NSCameraUsageDescription、NSContactsUsageDescription、NSMicrophoneUsageDescription等字段,之前这些都是预设的不用加,现在强制了,真是郁闷,下面贴上解决方案

被驳回的原因:

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.

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.

意思就是得在plist里面必须加上NSPhotoLibraryUsageDescription和NSCameraUsageDescription的键值对才行,之前都是默认的,现在必须加,要不不让通过,具体配置如下图:

info.png

也可以找到项目的info.plist文件,右击选中Open As -> source code 添加如下代码:
相机权限描述:

<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>

通信录:

<key>NSContactsUsageDescription</key>
<string>contactsDesciption</string>

麦克风:

<key>NSMicrophoneUsageDescription</key>
<string>microphoneDesciption</string>

相机:

<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>

其中,如果把<string>photoLibraryDesciption</string>中间photoLibraryDesciption去掉也可以,个人觉得更加简洁好看。

就这样就解决权限问题啦,不过如果实在还不行,你可以试试Clean,再运行就OK啦

相关文章

网友评论

    本文标题:xcode8 iOS10上关于NSPhotoLibraryUsa

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