这个答案是针对开发者的:
打开你的应用的代码,在info.plist中加NSLocationAlwaysUsageDescription和NSLocationWhenInUseUsageDescription
两项或者某一项都行。同时在定位的代码中加上:
if ([self.locationManger respondsToSelector:@selector(requestWhenInUseAuthorization)])
[self.locationManger requestWhenInUseAuthorization];
本文介绍如何在iOS应用中正确配置定位权限,通过在info.plist文件中添加NSLocationAlwaysUsageDescription和NSLocationWhenInUseUsageDescription键值,并在代码中调用requestWhenInUseAuthorization方法来请求使用中的定位授权。
1449

被折叠的 条评论
为什么被折叠?



