iOS11 获取定位设置后,定位任然不工作,看我就够了

2017-09-22  本文已影响185人  ShineYangGod

在iOS11中,苹果似乎增加了另一个隐私功能。
用户现在可以覆盖我们requestAlwaysAuthorization并将其降级为
requestWhenInUseAuthorization

/** Either the NSLocationAlwaysAndWhenInUseUsageDescription key or both the* NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription* keys must be specified in your Info.plist; otherwise, this method will do* nothing, as your app will be assumed not to support Always authorization.*/

然而,使用这个新的密钥 - 位置服务仍然没有工作,进一步的搜索,我发现这个宝石混合了所有额外的调试信息:
此应用程序尝试访问隐私敏感数据,而无需使用说明。
应用程序的Info.plist必须包含NSLocationAlwaysAndWhenInUseUsageDescription和NSLocationWhenInUseUsageDescription键,其中字符串值向用户解释应用程序如何使用此数据这与我在更新的
CLLocationManager.h 文件中发现的评论直接相矛盾。所以我创造了一个测试项目好消息,如果您按照调试控制台的建议添加新密钥
NSLocationAlwaysAndWhenInUseUsageDescription和旧密钥之一NSLocationWhenInUseUsageDescription,位置服务将再次开始工作。

上一篇下一篇

猜你喜欢

热点阅读