The initial Alert which will prompt to get location service for an app is triggered by the OS and not by the App.
This will be triggered as you would have enabled location based settings in your application.
But if the user deny it for the first time, according to the OS the user prefer to deny the location service for that particular app and this is users privacy.
As Apple is very much concerned about user’s privacy settings, for user to accept those settings again, they should explicitly enable it again from the settings App and it is not possible to achieve it from app level.
Because its nothing to do with the app and its purely OS based, and as a developer we cannot override it.
Instead we can detect the users current privacy setting for location, and if status in not having access, then you may prompt user an alert on which user may directly change the settings after navigating to settings app.
if([CLLocationManager locationServicesEnabled]){
if([CLLocationManager authorizationStatus]==kCLAuthorizationStatusDenied){
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:ICLocalizedString(@"LocationServicesPermissionTitle")
message:ICLocalizedString(@"LocationPermissionGeoFenceMessage")
delegate:self
cancelButtonTitle:@"Settings"
otherButtonTitles:nil];
[alert show];
}
}
UIAlertView delegate:
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
[alertView dismissWithClickedButtonIndex:buttonIndex animated:YES];
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: UIApplicationOpenSettingsURLString]];
}