Iphone 如何在iOS中检查特定应用程序的GPS权限处于打开或关闭状态?
使用 BOOL locaService=[CLLocationManager locationServicesEnabled] 它将返回通用GPS服务的布尔值,我们如何检查特定应用程序的服务是否打开。检查CLLocationManager 授权状态 返回应用程序使用位置的授权状态 服务。 +(授权状态)授权状态Iphone 如何在iOS中检查特定应用程序的GPS权限处于打开或关闭状态?,iphone,ios,objective-c,gps,Iphone,Ios,Objective C,Gps,使用 BOOL locaService=[CLLocationManager locationServicesEnabled] 它将返回通用GPS服务的布尔值,我们如何检查特定应用程序的服务是否打开。检查CLLocationManager 授权状态 返回应用程序使用位置的授权状态 服务。 +(授权状态)授权状态 [CLLocationManager authorizationStatus]返回一个CLAuthorizationStatus,其类型定义为kCLAuthorizationStatus
[CLLocationManager authorizationStatus]
返回一个CLAuthorizationStatus
,其类型定义为kCLAuthorizationStatusNotDetermined、kCLAuthorizationStatusRestricted、KClauthorizationStatusDenized、
或kCLAuthorizationStatusAuthorized
kclauAuthorizationStatusAuthorized
表示您可以使用GPS,其他任何表示您不能使用
(kCLAuthorizationStatusDenied
表示他们已禁止您,kCLAuthorizationStatusRestricted
表示由于家长控制,您不能,kCLAuthorizationStatusNotDetermined
表示用户尚未响应“允许此应用程序查看我的位置?”提示。)