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

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>
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容