如何在设置

时间:2016-08-04 03:34:12

标签: ios application-settings info.plist

我想在下面的图片设置中添加位置服务使用的应用说明。有谁知道如何做到这一点?谢谢! app explanation for location service

3 个答案:

答案 0 :(得分:7)

您可以在Xcode项目的Info.plist中添加说明。

<key>NSLocationAlwaysUsageDescription</key>
<string>The applicaiton requires location services to workss</string>

见下图

enter image description here

见下面的结果

enter image description here

答案 1 :(得分:1)

您可以在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>

enter image description here

并检查位置服务权限。

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];
            }
        }

答案 2 :(得分:1)

@Rurouni的答案是完美的。

Xcode中的一些更新8.它们为我们提供了plist中的隐私列表。

由此我们可以添加:

  

隐私 - 位置使用说明

<key>NSLocationUsageDescription</key>
<string>This application will use location service for user location sharing.</string>

enter image description here