2016-08-04 16 views
5

Tôi muốn thêm giải thích ứng dụng cho việc sử dụng dịch vụ vị trí trong cài đặt như hình dưới đây. Có ai có ý tưởng làm thế nào để làm điều này? Cảm ơn! app explanation for location serviceCách thêm giải thích ứng dụng cho dịch vụ định vị trong cài đặt

+0

Nếu bạn muốn thêm một số thông tin về ứng dụng của bạn trong thiết lập của iPhone. Bạn có thể sử dụng "Cài đặt nhóm". [hướng dẫn] (https://github.com/Weijay/SettingsBundle) – WeiJay

Trả lời

6

Bạn có thể thêm giải thích trong Info.plist trong dự án Xcode của mình.

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

xem hình ảnh dưới đây

enter image description here

xem kết quả dưới đây

enter image description here

1

Bạn có thể thêm mã trong 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

và cũng kiểm tra quyền dịch vụ vị trí.

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

@ Câu trả lời của Rurouni là hoàn hảo.

Một số cập nhật trong Xcode 8. Chúng cung cấp cho chúng tôi danh sách Bảo mật theo định dạng.

Từ đó chúng ta có thể thêm:

Privacy - Vị trí Cách sử dụng Mô tả

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

enter image description here

Các vấn đề liên quan