【发布时间】:2013-04-04 02:23:26
【问题描述】:
使用 BOOL locaService=[CLLocationManager locationServicesEnabled];
它将返回一般 GPS 服务的布尔值,我们如何检查特定应用程序的服务是打开还是关闭。
【问题讨论】:
标签: iphone ios objective-c gps
使用 BOOL locaService=[CLLocationManager locationServicesEnabled];
它将返回一般 GPS 服务的布尔值,我们如何检查特定应用程序的服务是打开还是关闭。
【问题讨论】:
标签: iphone ios objective-c gps
[CLLocationManager authorizationStatus] 返回一个CLAuthorizationStatus,其类型定义为kCLAuthorizationStatusNotDetermined, kCLAuthorizationStatusRestricted, kCLAuthorizationStatusDenied, 或kCLAuthorizationStatusAuthorized。
kCLAuthorizationStatusAuthorized 表示您可以使用 GPS,其他任何内容都表示您不能。
(kCLAuthorizationStatusDenied 表示他们已禁止您,kCLAuthorizationStatusRestricted 表示由于家长控制您不能,kCLAuthorizationStatusNotDetermined 表示用户尚未响应“允许此应用查看我的位置?”提示.)
【讨论】:
在 CLLocationManager 中检查 authorizationStatus。
授权状态
返回应用程序使用位置的授权状态 服务。 + (CLAuthorizationStatus)授权状态
【讨论】: