Warm tip: This article is reproduced from serverfault.com, please click

How to remove ios geolocation auth request message on cordova

发布于 2020-11-26 00:58:44

I am making an app using Cordova.

Certain pages(index.html) in Cordoba ask for location permission, which is for a function.

After modifying the plist in Xcode to get location permissions, I keep getting the following message

here is my setting and occured message

enter image description here

enter image description here

I looked for a solution to why this message(/private/var/containers/Bundle/Application... /www/index.html Geolocation auth) appeared, but there was no right answer. What should I do?

Questioner
Cwpark
Viewed
0
Eric 2020-12-01 04:51:37

You need to install cordova-plugin-geolocation (cordova plugin add cordova-plugin-geolocation) then set your preferences in your config.xml, for iOS, such as

    <edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
        <string>need to access your location for reasons</string>
    </edit-config>
    <edit-config file="*-Info.plist" mode="merge" target="NSLocationAlwaysAndWhenInUseUsageDescription">
        <string>need to access your location for reasons</string>
    </edit-config>
    <edit-config file="*-Info.plist" mode="merge" target="NSLocationAlwaysUsageDescription">
        <string>need to access your location for reasons</string>
    </edit-config>

Of course edit

need to access your location for reasons