In my app, if the user not allowed to access their current location, I can recieve that message in the following method
- (void)locationManager:(CLLocationManager*)aManager didFailWithError:(NSError*)anError
{
switch([anError code])
{
case kCLErrorLocationUnknown:
break;
case kCLErrorDenied:
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Access Denied" message:@"You didn't allow to access your current location" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show];
break;
}
}
}
How to ask the user permission for the second time?
I searched and got the answer NO, If the user wants the app to access his/her location, how he/she set the app to use their current location?
Is deleting the app and download another one the only solution?
Is this just me or what? There are several questions like this. Each of which are answered by what the user should do to reenable the location service instead of what the the programmer should do to get that precious consistent alert.
call
[singleton.locationManager startUpdatingLocation];
That's actually what pops the alert.
If you don't call it, then the alert doesn't show up.
If you check first if it's enabled and then call it only if it's enabled, then the alert doesn't show up.
I spent weeks figuring this out. There is no info whatsoever about this in internet.
I think Yes. Deleting the app and download another one is the only solution as that alert message asking user's permission to access location settings is not getting fired by the app but by iPhone OS and hence in my opinion you can't ask it programatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With