Reputation: 353
I have an app with location services. If I disable location services in preferences, I check this state with this method: [CLLocationManager locationServicesEnabled]
This method return if are all location services enabled or disabled. But problem is that I don't know, how to check state of location service for my app. I mean state when are all location services enabled and disabled is only my app ? How can I check this ? [CLLocationManager locationServicesEnabled]
not working here ... Thanks a lot ..
Upvotes: 0
Views: 426
Reputation: 1271
I use this in my code, and it work fine
if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized )
{
//do something
}
else
{
//display an alert for example
}
Upvotes: 1
Reputation: 3408
Returns the application’s authorization status for using location services.
+ (CLAuthorizationStatus)authorizationStatus
Return Value
A value indicating whether the application is authorized to use location services.
Upvotes: 1