美文网首页iOS开发
iOS开发-iOS11获取定位权限失败的解决方法

iOS开发-iOS11获取定位权限失败的解决方法

作者: Pandakingli | 来源:发表于2017-11-17 09:38 被阅读39次

6:关于iOS11定位失效的问题解决方案

This app has attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain both NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationWhenInUseUsageDescription keys with string values explaining to the user how the app uses this data

具体原因是苹果原来的永久定位权限已经下降为使用期间
需要新增如下两个权限,
NSLocationAlwaysAndWhenInUseUsageDescription 和 NSLocationWhenInUseUsageDescription
在plist文件中添加这两个就可以了。

    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
    <string>允许访问位置</string>

相关文章

网友评论

    本文标题:iOS开发-iOS11获取定位权限失败的解决方法

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