美文网首页iOS10 适配
iOS10 适配 权限

iOS10 适配 权限

作者: 墓志铭333 | 来源:发表于2016-09-20 12:11 被阅读38次

iOS 10对于隐私数据保护又一步加强:

You must statically declare your app’s intended use of protected data classes by including the appropriate purpose string keys in your Info.plist file.

就是说在访问用户数据时都需要在Info.plist中进行声明,否则就崩溃。

需要声明的数据权限如下图所示:

iOS10 适配权限

常用的有: 通讯录 媒体库 相册 相机 麦克风 地理位置

在plist中加入字段之后如下所示:

<key>NSPhotoLibraryUsageDescription</key>

<string</string>

<key>NSCameraUsageDescription</key>

<string></string>

<key>NSMicrophoneUsageDescription</key>

<string></string>

Value字段可以为空, 如果有值会在获取权限弹窗中显示

注意: 在iOS10 正式发布之后 该字段Value不得为空,否则提交的构建版本,在iTunesconnect上无法看见,同时接受到邮件:

We have discovered one or more issues with your recent delivery for "***". To process your delivery, the following issues must be corrected:

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.

添加时, 输入 "Privacy"下部就会有所有的提示

相关文章

网友评论

    本文标题:iOS10 适配 权限

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