Reputation: 41
I am using Phonegap Build for my iOS app and get the ugly prompt for access to geolocation API.
There seems to be many fixes and none of them solved my issue. What I have currently - which does not fix it is:
Any ideas?
Upvotes: 0
Views: 897
Reputation: 446
To change the prompt you just need to update geolocation plugin. In my case when I updated cordova-plugin-geolocation prompt containing index.html path disappeared.
Upvotes: 0
Reputation: 1
The user @kaae is correct-- if you call the geolocation functions before the device is ready, the natural browser alert prompt will show instead of being handled by the plugin.
Although you have stated "geolocation not fired before device is ready" the fact that you're seeing that native browser prompt means that it is.
You can have the geolocation functions outside, but the call to them should be inside:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() { [CALL TO FUNCTION HERE] }
Since this question is number one on Google, I felt the need to comment for others using ionic or cordova and having this issue.
Upvotes: 0
Reputation: 41
This fix was to wait setting up the geolocation callbacks till later in the flow.
Upvotes: -1