i am using cordova 6 with onsen-ui,jquery and javascript. So i am trying to make a simple login site, but i need to get if gps is active. I want to know WHERE i must do that validation. Now I do the following on ons.ready() event.
var options = {maximumAge: 0, timeout: 3000, enableHighAccuracy:true};
navigator.geolocation.getCurrentPosition(onGPSCheckSuccess, onGPSCheckError, options);
function onGPSCheckSuccess()
{
console.log("Encontro el GPS Activado");
}
function onGPSCheckError()
{
console.log("Error al chequear el GPS");
gpsDetect.switchToLocationSettings(onSwitchToLocationSettingsSuccess, onSwitchToLocationSettingsError);
}
function onSwitchToLocationSettingsSuccess() {
}
function onSwitchToLocationSettingsError(e) {
console.log("Error al activar el GPS");
alert("Error onSwitchToLocationSettingsError: "+e);
}
So if there a way to do this BEFORE my main page es loaded?
Regards