My app has a map right in the first ViewController. On iOS 7, it automatically showed the Location permission popup right away at the first run. On iOS 8, however, some changes are needed. I've included the key NSLocationWhenInUseUsageDescription
to my Info.plist file, and at the AppDelegate I've added:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// ...
if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined) {
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
[locationManager requestWhenInUseAuthorization];
}
// ...
}
Yet, the popup is never shown.
The UI has a button to bring the map back to the user's location. In the button's method, I've included the same piece of code as above to see if it would help.
This time the pop up does appear, but it just blinks on the screen, and the user cannot interact with it.
On Settings > Privacy > Location Services > MyApp there are the two options I expect: Never and While Using the App. None of them is marked by default. Also, the "App explanation" that I set in the Info.plist is shown correctly in the second option.
If I forcedly mark the second option, the app works properly, but I don't want the user to manually browsing through the options to enable it.