Monday, 10 October 2016

iphone - how do I detect location service disable for my app?

IOS4 has recently introduced the possibility to enable/disable location services for a specific application.




I need to detect if this settings is enabled/disabled for MY application.



First I have tried with:



if ([CLLocationManager locationServicesEnabled])
{
....
}



however this refers to the global location service and not to the specific application setting.



Second I have tried to use



- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
...
}



It works but it gets called both in case of service app setting disabled and in other cases like, for example, if a measure fails for some reasons.



I need a code to detect if MY application is allowed to use location services.



How can i achieve this?



Thanks for your support

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...