Lord Vermillion
Lord Vermillion

Reputation: 5424

ios 8 Locationmanager not asking for permission

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: enter image description here

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

Answers (1)

Jakub Truhlář
Jakub Truhlář

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

Related Questions