简体   繁体   English

iOS:已授予权限?

[英]iOS: Has granted permission?

Is there a Core Location object that we can ask to see if the user has granted the app the right to give their location? 我们是否可以询问核心位置对象,以查看用户是否已授予该应用授予其位置的权限?

Currently we have to check to see if the location object's Coordinate IsValid each time. 当前,我们必须每次查看位置对象的坐标IsValid。

Take a look at CLLocationManager 's + (CLAuthorizationStatus)authorizationStatus method. 看一下CLLocationManager+ (CLAuthorizationStatus)authorizationStatus方法。 It's since iOS 4.2 and tells you the app's authorisation state. 自iOS 4.2起,它会告诉您应用程序的授权状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM