针对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 ...
随机推荐
- IOS传值之代理传值(一)
1.使用代理delegate的方法 2.使用通知Notification的方法 3.KVO等方法 4.block传值 ~~~~~~~~~~~~~~~~ 1.使用代理delegate的方法 #impor ...
- and的用法(&)
经常看到jq的源码中各种&连接在一起赋值一个变量, 例一: var b = a&&a.getName 例二: var b = a&&a.getName||d 例 ...
- PHP的curl实现get,post 和 cookie
类似于dreamhost这类主机服务商,是显示fopen的使用 的.使用php的curl可以实现支持FTP.FTPS.HTTP HTPPS SCP SFTP TFTP TELNET DICT FILE ...
- typeof判断类型(数组类型得用instanceof)
var a= 1; console.log(typeof a); var b= '1'; console.log(typeof b); var c; console.log(typeof c); va ...
- get 和 post请求的区别
(1)GET请求用于获取信息,从Client的角度看,不会改变资源状态,并且多次对同一URL的多个请求应该返回相同的结果. GET请求的参数会显示在URL中,即放置在HTTP协议头中(所 ...
- 后台运行之BackgroundWorker
BackgroundWorker 类允许您在单独的专用线程上运行操作. 耗时的操作(如下载和数据库事务)在长时间运行时可能会导致用户界面 (UI) 似乎处于停止响应状态. 如果您需要能进行响应的用户界 ...
- OpenGL ES着色器语言之操作数(官方文档第五章)
OpenGL ES着色器语言之操作数(官方文档第五章) 5.1操作数 OpenGL ES着色器语言包含如下操作符. 5.2数组下标 数组元素通过数组下标操作符([ ])进行访问.这是操作数组的唯一操作 ...
- linux的视频学习4(网络配置和rpm)
linux的视频学习: 1.网络配置的三种方式的介绍. 第一种方式: setup 命令--选择network configuration-->配置固定ip(tab键)和自动分配IP(长空格) / ...
- Activity与Activity之间的传值
//----------Activity1中的布局--------------------------------- <LinearLayout xmlns:android="http ...
- Callable、Future和FutureTask区别
在前面的文章中我们讲述了创建线程的2种方式,一种是直接继承Thread,另外一种就是实现Runnable接口. 这2种方式都有一个缺陷就是:在执行完任务之后无法获取执行结果. 如果需要获取执行结果,就 ...