My app uses navigator.geolocation provided by PhoneGap. When running the app on iPhone is asks for location permissions twice, i guess one for the app and one for safari, how do i solve this?
Asked
Active
Viewed 5,753 times
4 Answers
2
I was having the same problem, but this fixed it: Location permission alert on iPhone with PhoneGap
you have to rely on OnDeviceReady(), and it'll only call once.

Community
- 1
- 1

Michael Belt
- 36
- 2
1
Call the geolocation initialisation in onDeviceReady
Method and load this in body tag
function onDeviceReady(){
return navigator.geolocation.getCurrentPosition(initialize);
}
-
This did not work for me somehow. It asks for permissions twice – Biswas Khayargoli Dec 23 '19 at 08:22
0
Unfortunately, you can't disable the second alert, because it is coming from WebKit and not iOS. However, I suggest you write a bug on the WebKit Bugzilla and ask them to disable the second alert when PhoneGap is being used in an app if you believe two confirmation messages will be confusing to the user.
Ad@m

kirb
- 2,033
- 1
- 18
- 28