Reputation: 5424
I can't get LocationManager to work with IOS8, i've added the two new values to plist and i do the request. But it still does not work. What am i doing wrong?
Plist:
This is my code:
locationManager = [[CLLocationManager alloc] init];
locationManager.distanceFilter = kCLDistanceFilterNone;
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters;
[locationManager requestAlwaysAuthorization];
[locationManager startUpdatingLocation];
float latitude = locationManager.location.coordinate.latitude;
float longitude = locationManager.location.coordinate.longitude;
I get no request for permission.
Upvotes: 0
Views: 512
Reputation: 20710
First try remove your app from simulator/device.
Then Change your authorization line to:
if ([locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) {
[[[LocationManager sharedInstance] locationManager] requestAlwaysAuthorization];
}
Add NSLocationAlwaysUsageDescription to your plist (try it with/without WhenInUseUsageDescription as the second).
Upvotes: 1