I’ve been roaming around the documentation for CLLocationManager and don’t see anywhere that states what happens when a user accepts location services. I’m looking for a certain method that would be called similar to when a user denies the use of location services and didFailWithError gets called.
I’ve tried methods such as didUpdateToLocation and didEnterRegion with breakpoints, but nothing gets called when I hit “ok” for location services.
Thanks,
What you’re looking for is
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status
which is underCLLocationManagerDelegateFrom there, you can determine the user’s status by checking if the status is
kCLAuthorizationStatusNotDetermined,kCLAuthorizationStatusRestricted,kCLAuthorizationStatusDenied, orkCLAuthorizationStatusAuthorizedBeware, though, this behavior gets a little tricky in iOS4 vs. iOS5. I think it’s in iOS4 that this become persistent even when a user deletes the app.