I would like to add app explanation for location service usage in setting like below image. Does anyone have idea how to do this? Thanks!
How to add app explanation for location service in settings
Asked Answered
If you want to add some information about your app in iPhone's setting. You can use "Bundle Settings." tutorial –
Maidenhead
You can add an explanation in Info.plist in your Xcode project.
<key>NSLocationAlwaysUsageDescription</key>
<string>The applicaiton requires location services to workss</string>
see the below image
see the result below
You can add the code in info.plist
<key>NSLocationAlwaysUsageDescription</key>
<string>This application requires location services to work</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This application requires location services to work</string>
and also check the location service permission.
if([CLLocationManager locationServicesEnabled]){
NSLog(@"Location Services Enabled");
if([CLLocationManager authorizationStatus]==kCLAuthorizationStatusDenied){
alert = [[UIAlertView alloc] initWithTitle:@"App Permission Denied"
message:@"To re-enable, please go to Settings and turn on Location Service for this app."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
}
}
@Rurouni's answer is perfect.
Some Updates in Xcode 8. They give us list of Privacy in plist.
From that we can add :
Privacy - Location Usage Description
<key>NSLocationUsageDescription</key>
<string>This application will use location service for user location sharing.</string>
© 2022 - 2024 — McMap. All rights reserved.