📖 View this page in our documentation

Overview

You may enable location services for your app within the App Permissions section of your app builder. This will allow your app to provide location-based services like Google Maps.

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 a 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:

if (navigator.userAgent.indexOf('GoNativeIOS') > -1) {
    function gonative_geolocation_ready() {
         // call navigator.geolocation.getCurrentPosition in this function
    }
} 
else {
    // call navigator geolocation.getCurrentPosition right away directly
}

Prompt user to enable Location Services on Android

If you have your Location Services disabled in your app builder, you may dynamically enable the location services within your app on Android devices by using the following GoNative JavaScript Bridge command.

View GoNative JavaScript Bridge example code in our documentation