2
votes

When I tried to fetch my current location IOS displayed alertview like " "Application" would like to use your current location" with "Dont Allow" and "Ok". I tapped "Dont Allow". Then whenever I opened application and tried to fetch current location it does not displayed that previous message again. Is it possible to make alert view each time (only when user selected "Dont Allow" previously) I tried [CLLocationManager authorizationStatus]; and it showed me error like

The operation couldn’t be completed. (kCLErrorDomain error 1.) I would like to get the same "system generated" alert view again. Please help.

1

1 Answers

1
votes

You can check the status in your own code using the + (BOOL)locationServicesEnabled method of CLLocationManager. If the user denied the location service for your app or for the whole device (e.g. flight mode), you will get an error in - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error in your delegate.

I also found an example. Look at the - (BOOL) isGPSEnabled method.