0

"/users/home/library/developer/coresimulator/devices/785G44J-583J-73F0-44DG-1EN44K5M3/data/Containers/Bundle/Application/4JD4NJFD-J2MFK-34MD-543MKNK34K6656/APPName.app/www/index.html"Would like to Use your location"

To display map in my application I use geolocation methods to get current location.

This alert appears in the application for access of location.It comes frequently.

How to remove this alert? I have not added geolocation plugin,just used some javascript methods like

navigator.geolocation.getCurrentPosition(getCoor, errorCoor, {maximumAge:60000, timeout:5000, enableHighAccuracy:true})

and navigator.geolocation.watchPosition(scrollMap, handleError);

On install of the app the alert which asks the access should only come,which is "Allow 'appname' to access ypur location while you use your app?". and other alerts shud be removed.

I have searched about this but dint solve the issue

How can i do this please help..

Prarthana
  • 87
  • 1
  • 13

2 Answers2

0

You have to add geolocation plugin, if you don't add it, then it uses the webview default geolocation that displays that message with "index.html" instead of "AppName"

Add it with this command

cordova plugin add cordova-plugin-geolocation
jcesarmobile
  • 51,328
  • 11
  • 132
  • 176
0

In addition to installing the cordova-plugin-geolocation you will also need to configure it:

https://stackoverflow.com/a/48219988/596082

This is a key privacy permission that your users need to accept before your app can use.

Stan
  • 1,251
  • 1
  • 15
  • 24