NativeJS - iOS location prompt

Disable double location prompt on iOS

We have done a native override of the geolocation, so that only the app will ask for permission.
The one caveat is that we only override the web-based geolocation with our native one after the page has loaded. So, there is potential timing issue if you call the javascript geolocation before we do the native override.
So, the solution is that once we finish doing the native binding, we will call a javascript function gonative_geolocation_ready();
So, you will need to delay the location prompt until that function is called. For example:
1
if (navigator.userAgent.indexOf('GoNativeIOS') > -1) {
2
function gonative_geolocation_ready() {
3
// call navigator.geolocation.getCurrentPosition in this function
4
}
5
}
6
else {
7
// call navigator geolocation.getCurrentPosition right away directly
8
}
Copied!
Last modified 1yr ago
Copy link