I'm trying to use significant change location monitoring in iOS 8, but the didUpdateLocations method is never called. Here is the code for setting up the location manager:
- (void)viewDidLoad
{
[super viewDidLoad];
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
[locationManager requestWhenInUseAuthorization];
[locationManager startMonitoringSignificantLocationChanges];
}
Despite calling requestWhenInUseAuthorization
, nothing pops up to ask the user to authorize it. I have set NSLocationWhenInUseUsageDescription, and it still does not work. didChangeAuthorizationStatus
and didFailWithError
are also never called.
EDIT: I was able to get it to ask the user to allow location services, but even if you click allow it never shows the location.
There is currently a bug in iOS8 beta5 which always deactivate geolocation service for your app (at least for mine).
Go in settings > Privacy > Location services > Your app > Always
.
But I don't know why, but even if you set it to Always
this setting will auto-deactivate, so please be patient and often return in the settings to configure again your app location.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With