针对iOS10的各种问题的解决方法
1、iOS10相册相机闪退bug:
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.
修复方法:
(1)在info.plist文件下添加一下代码:
相机权限
<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>
相册权限
<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>
在网上还有一个说法,跟上述几乎一样只不过多设置了两项权限:
(2)你需要在info.plist文件 添加一个“NSContactsUsageDescription ”的Key,Value添加一个描述。需要在应用的info.plist里加入(使用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>
2、iOS10因苹果健康导致闪退crash
如果在app中调用了苹果健康,iOS10中会出现闪退。控制台报错的原因是:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSHealthUpdateUsageDescription must be set in the app's Info.plist in order to request write authorization.'
这是因为我们要在info.plist文件中声明苹果的使用权限,所以在info.plist中添加一下key就可以l
请求写入:
<key>NSHealthUpdateUsageDescription</key>
<string>some string value stating the reason</string>
请求读取
<key>NSHealthShareUsageDescription</key>
<string>some string value stating the reason</string>
另外附加一些其他权限描述:
相机权限描述:
<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>
通讯录
<key>NSContactsUsageDescription</key>
<string>contactsDesciption</string>
麦克风
<key>NSMicrophoneUsageDescription</key>
<string>microphoneDesciption</string>
相机
<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>
3、iOS10配置须知
在iOS10中,如果你的App想要访问用户的相机、相册、麦克风、通讯录等等权限,都需要进行相关的配置,不然会直接crash。
需要在info.plist中添加App需要的一些设备权限。
NSBluetoothPeripheralUsageDescription
访问蓝牙
NSCalendarsUsageDescription
访问日历
NSCameraUsageDescription
相机
NSPhotoLibraryUsageDescription
相册
NSContactsUsageDescription
通讯录
NSLocationAlwaysUsageDescription
始终访问位置
NSLocationUsageDescription
位置
NSLocationWhenInUseUsageDescription
在使用期间访问位置
NSMicrophoneUsageDescription
麦克风
NSAppleMusicUsageDescription
访问媒体资料库
NSHealthShareUsageDescription
访问健康分享
NSHealthUpdateUsageDescription
访问健康更新
NSMotionUsageDescription
访问运动与健身
NSRemindersUsageDescription
访问提醒事项
暂时先总结这么多,继续搜集……
针对iOS10的各种问题的解决方法的更多相关文章
- 启动tomcat时 一闪而过解决方法
1 首先确定JAVA 已经配好了环境变量,具体配置方法,找一下度娘. 测试方法:进入cmd -> javac -version 能看到JAVA的版本信息,证明配置成功了. 2 分析一下问题出现的 ...
- 针对应用程序池“xxxxxx”的模板永久性缓存初始化失败,解决方法
日志名称: Application 来源: Active Server Pages 日期: 2014-11-22 9:09:39 事件 I ...
- 更新xcode后插件失效问题——不针对特定版本的通用解决方法
一.Xcode更新后插件失效的原理 1.每次更新Xcode后插件都会失效,其实插件都还在这个目录好好的躺着呢: ~/Library/Application Support/Developer/Shar ...
- 斯坦福大学公开课机器学习: advice for applying machine learning | deciding what to try next(revisited)(针对高偏差、高方差问题的解决方法以及隐藏层数的选择)
针对高偏差.高方差问题的解决方法: 1.解决高方差问题的方案:增大训练样本量.缩小特征量.增大lambda值 2.解决高偏差问题的方案:增大特征量.增加多项式特征(比如x1*x2,x1的平方等等).减 ...
- 针对piix4_smbus ****host smbus controller not enabled的解决方法
SMBus 目录 SMBus与I2C的差别 SMBus 是 System Management Bus 的缩写,是1995年由Intel提出的,应用于移动PC和桌面PC系统中的低速率通讯.它主要是希望 ...
- Node.js中针对中文的查找和替换无效的解决方法
Node.js中针对中文的查找和替换无效的解决方法. //tags的值: tag,测试,帖子 var pos1 = tags.indexOf("测"); //这里返回-1 ta ...
- ios10 safari浏览器 在touchmove 里面写e.preventDefault(); 不起作用 的解决方法
最近做手机端项目遇到一个问题,就是在ios10系统里面 safari浏览器 在touchmove 里面写e.preventDefault();不起作用 更种google 还是没有找到解决方法 最后找 ...
- Oracle存储过程中不支持DML语言的解决方法(针对遇见的DROP关键字)
---存储过程中的原语句: ---删除表 DROP TABLE A_NEWTDDATA; --报错 经查询:存储过程不支持DML语言: 解决方法: execute immediate 'DROP TA ...
- 针对Windows 64位系统中Matlab没有LED Control Activex控件的解决方法
Win 10 64bits系统中Matlab 64位软件没有LED Control Activex控件,LED ActiveX Control控件位于Gauges Blockset模块中,而Gauge ...
随机推荐
- s7-300 第二讲
- androidstudio 问题
Error:(1, 1) A problem occurred evaluating project ':app'. > Failed to apply plugin [id 'com.andr ...
- C# 截取字符串某个字符分割的最后一部分
例如 string s1="123.456.789",想截取得到的新字符串为“789” 代码如下: string s1 = "123.456.789"; str ...
- 一个不错的PHP文件页面缓存类
在php中缓存分类数据库缓存,文件缓存和内存缓存,下面我来给各位同学详细介绍PHP文件缓存类实现代码,有需要了解的朋友可参考. 页面缓存类 <?php /* * 缓存类 cac ...
- Office2003/2010等集成SP的简单方法
Office2003集成SP的简单方法 需要准备的工具:Office 2003 光盘镜像.SP3更新包.Office 2003 序列号.UltraISO,7-zip或winrar,虚拟光驱 步骤一:提 ...
- 关于c中的inline
在c中,为了解决一些频繁调用的小函数大量消耗栈空间或是叫栈内存的问题,特别的引入了inline修饰符,表示为内联函数.栈空间就是指放置程式的局部数据也就是函数内数据的内存空间,在系统下,栈空间是有限的 ...
- js 判断网页类型
<html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>标题页</title ...
- MySQL 5.7 for Windows 解压缩版配置安装
从MYSQL5.7.6开始,安装MYSQL提示“请键入 NET HELPMSG 3534 以获得更多的帮助”的解决办法 今天安装MySQL提示如下错误: ----------------------- ...
- 【将txt文本转图片】
[测试类] public static void main(String[] args) { try { File textFile = new File("F:\\java56班\\ecl ...
- 【转】bootstrap 的 affix.js 插件
我觉得 Twitter Bootstrap 提供的 JavaScript 插件可用性非常高,但文档多数简单.按部就班操作了,有效果当然好,没效果的话简直不知道为什么.之前我写过 Scrollspy 用 ...