当前位置: 移动技术网 > 移动技术>移动开发>IOS > IOS10 解决权限崩溃问题详解

IOS10 解决权限崩溃问题详解

2019年07月24日  | 移动技术网移动技术  | 我要评论

     今天 手机升级了 ios10 beta,然后用正在开发的项目 装了个ipa包,发现点击有关 权限访问 直接crash了,并在控制台输出了一些信息:

this app has crashed because it attempted to access privacy-sensitive data without a usage description.  the app's info.plist must contain an nscontactsusagedescription key with a string value explaining to the user how the app uses this data.

意思是说:你需要在info.plist文件 添加一个“nscontactsusagedescription ”的key,value添加一个描述。 

1,在项目中找到info.plist文件,右击有个 open as,以source code 的形式打开

2,分别复制 以下 value 和key,key 一定不能错,value 貌似可以随便填写

相机权限描述:

    <key>nscamerausagedescription</key>
    <string>cameradesciption</string>

通信录:

    <key>nscontactsusagedescription</key>
    <string>contactsdesciption</string>

麦克风: 

   <key>nsmicrophoneusagedescription</key>
    <string>microphonedesciption</string>

相机:

    <key>nsphotolibraryusagedescription</key>
    <string>photolibrarydesciption</string>
 

eg:其他权限描述,debug 控制台都会有输出的,自行添加就ok

3,在info.plist 文件上 复制上,然后 保存,如下图:

source code 的形式:

 

property list 的展现形式:

4,clean之后,运行就ok了

 通过此文希望能帮助到大家解决 ios10 权限崩溃的问题,谢谢大家对本站的支持!

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网