Ask for 'always' location permissions, too
This commit is contained in:
@@ -2214,7 +2214,15 @@ CLLocationCoordinate2D MGLLocationCoordinate2DFromLatLng(mbgl::LatLng latLng)
|
||||
[NSException raise:@"Missing Location Services usage description" format:
|
||||
@"In iOS 8 and above, this app must have a value for NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription in its Info.plist."];
|
||||
}
|
||||
[self.locationManager requestWhenInUseAuthorization];
|
||||
// request location permissions, if both keys exist ask for less permissive
|
||||
if ([[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationWhenInUseUsageDescription"])
|
||||
{
|
||||
[self.locationManager requestWhenInUseAuthorization];
|
||||
}
|
||||
else if ([[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationAlwaysUsageDescription"])
|
||||
{
|
||||
[self.locationManager requestAlwaysAuthorization];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user