In a simple project, I instantiate a Core Location Manager:
- (void)viewDidLoad {
[super viewDidLoad];
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.desiredAccuracy =
kCLDistanceFilterNone;
self.locationManager.delegate = self;
if([CLLocationManager locationServicesEnabled]) {
// Location Services Are Enabled
switch([CLLocationManager authorizationStatus]) {
case kCLAuthorizationStatusNotDetermined:
NSLog(@"1");
[self.locationManager requestWhenInUseAuthorization];
NSLog(@"requested auth");
break;
case kCLAuthorizationStatusRestricted:
NSLog(@"2");
break;
case kCLAuthorizationStatusDenied:
NSLog(@"3");
break;
case kCLAuthorizationStatusAuthorized:
NSLog(@"4");
break;
}
} else {
// Location Services Disabled
}
[self.locationManager startUpdatingLocation];
}
I also have the appropriate keys in info.plist:
the log output, based on this code, is:
[233:5927] 1
[233:5927] requested auth
but i get no authorization request...
no errors and no location updates (if I implement the delegate callbacks)
Stupid mistake, added the keys in the wrong plist file (the testing one instead of the app one )