iOS10 权限以及相关设置
2017-08-29 10:29
435 查看
权限以及相关设置
iOS10系统下调用系统相册、相机功能,或者苹果健康都会遇到闪退的情况,调用系统相册报错描述如下: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-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>如果不起作用,可以请求后台权限,类似于这样:
<key>UIBackgroundModes</key>
<array>
<!-- 在这里写上你在后台模式下要使用权限对应的key -->
<string>location</string>
...
</array>或者在info.plist—Property List中添加
麦克风权限:Privacy - Microphone Usage Description
通讯录权限: Privacy - Contacts Usage Description
蓝牙权限:Privacy - Bluetooth Peripheral Usage Description
语音转文字权限:Privacy - Speech Recognition Usage Description
日历权限:Privacy - Calendars Usage Description
定位权限:Privacy - Location When In Use Usage Description(在使用应用期间开启定位)
定位权限:Privacy - Location Always Usage Description(总是开启定位)
相关文章推荐
- iOS10 Info.plist相关权限设置
- iOS10 的相关权限设置
- vsftpd使用虚拟账号功能以及设置相关权限
- iOS开发中info.plist相关配置(附iOS10权限设置)
- 适配iOS10 的相关权限设置
- iOS10系统下调用系统功能权限以及相关设置
- 适配iOS10 的相关权限设置
- 适配iOS10 的相关权限设置
- 适配iOS10 的相关权限设置
- 详解适配iOS10 的相关权限设置
- 适配iOS10 的相关权限设置
- IOS10 相关权限设置总结
- 适配iOS10 的相关权限设置
- ftp服务软件安装和使用以及目录访问权限设置
- Android ListView的item背景色设置以及item点击无响应等相关问题
- Ubuntu系统中MySQL服务器搭建,用户设置权限,以及允许网络访问
- linux查看及修改文件权限以及相关
- 如何在cPanel中创建新MySQL数据库、用户以及设置权限
- 自定义Flash背景的相关设置方法以及其与目录下的文件的对应关系
- IIS权限设置的安全相关设置