Location permission alert on iPhone with Cordova

前端 未结 3 1705
天命终不由人
天命终不由人 2020-12-03 19:55

I\'m working on a cordova app on which I have to locate the user latitude and longitude. Using the geolocation plugin, it works fine on android dev

3条回答
  •  时光取名叫无心
    2020-12-03 20:23

    You can't disable the request message, either in the emulator or on the device, but you can customise it by adding a property to your project's .plist.

    For iOS 8, if your app requests permission to use location in the background, you want the following key (set the string value to anything you like):

    NSLocationAlwaysUsageDescription
    My app requires constant access to your location, even when the screen is off.
    

    If your app only uses location while in the foreground, then add the following key:

    NSLocationWhenInUseUsageDescription
    My app requires access to your location when the screen is on and the app is displayed.
    

    For older versions of iOS (<=7) you need to use NSLocationUsageDescription

提交回复
热议问题