2016-08-04 22 views
5

Ich möchte App-Erklärung für die Verwendung des Standortdienstes in der Einstellung wie unten Bild hinzufügen. Hat jemand eine Idee, wie man das macht? Vielen Dank! app explanation for location serviceWie App-Erklärung für Standortdienst in Einstellungen hinzufügen

+0

Wenn Sie einige Informationen über Ihre App in iPhone-Einstellung hinzuzufügen. Sie können "Bundle-Einstellungen" verwenden. [Anleitung] (https://github.com/Weijay/SettingsBundle) – WeiJay

Antwort

6

Sie können eine Erklärung in Info.plist in Ihrem Xcode-Projekt hinzufügen.

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

siehe das Bild unten

enter image description here

das Ergebnis unter

enter image description here

1

Sie sehen den 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> 
hinzufügen

enter image description here

und überprüfen Sie auch die Standortdienstberechtigung.

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

@ Rurounis Antwort ist perfekt.

Einige Updates in Xcode 8. Sie geben uns eine Liste der Privatsphäre in Plist.

Von dass wir hinzufügen:

Privatleben - Standort Verwendung Beschreibung

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

enter image description here