I have an app that want to get user location.
As you may know, Apple change user private policy (as i suggest) and, now i can't get user location. It show no error, no warning, nothing. In attempt to fix this i add following code before calling [_locationManager startUpdatingLocation];
There it is:
CLAuthorizationStatus authStatus = [CLLocationManager authorizationStatus];
if (authStatus == kCLAuthorizationStatusNotDetermined) {
[_locationManager requestWhenInUseAuthorization];
NSLog(@"Case 1");
return;
};
if (authStatus == kCLAuthorizationStatusDenied || authStatus == kCLAuthorizationStatusRestricted) {
// show an alert
NSLog(@"Case 2");
return;
};
And output is Case 1, which mean - authStatus == kCLAuthorizationStatusNotDetermined
.
But there is no alert, no prompt, no suggestion to user to enable location services for my app. Actually, i even turn it on manually in settings of my iPhone. Still, not working (it work perfectly before Xcode update).
How to fix that? Any advices would be appreciated, thanks!