2016-08-04 25 views
5

Chciałbym dodać wyjaśnienie do aplikacji dotyczące korzystania z usług lokalizacyjnych w ustawieniach takich jak poniższe zdjęcie. Czy ktoś ma pomysł, jak to zrobić? Dzięki! app explanation for location serviceJak dodać wyjaśnienie aplikacji do usługi lokalizacji w ustawieniach

+0

Jeśli chcesz dodać informacje o swojej aplikacji w otoczeniu iPhone. Możesz użyć "Ustawienia pakietu". [samouczek] (https://github.com/Weijay/SettingsBundle) – WeiJay

Odpowiedz

6

Możesz dodać wyjaśnienie w Info.plist w swoim projekcie Xcode.

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

patrz poniższy obraz

enter image description here

zobaczyć wynik poniżej

enter image description here

1

Możesz dodać kod w 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

, a także sprawdź uprawnienie do usługi lokalizacyjnej.

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

@ Odpowiedź Rurouni jest idealna.

Niektóre aktualizacje w Xcode 8. Dają nam listę prywatności w plist.

Z tego możemy dodać:

Prywatność - Lokalizacja Zastosowanie Opis

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

enter image description here