cordova-plugin-geolocation-android-activator
v1.1.2
Published
Simple method to activate gps if it is turned off.
Downloads
7
Maintainers
Readme
cordova-plugin-geolocation-android-activator
Simple complement for geolocation plugins, like apache's cordova-plugin-geolocation, that asks the user to give permission to access geolocation and to activate the GPS.
To use
Just call it
If the user allows or have previously allowed the app to access geolocation and GPS was allowed to be activated or was already active, the success callback will be executed. In any other case, the failure callback will.
navigator.geolocation.activator.askActivation(function(response) {
//Success callback
}, function(response) {
//Failure callback
});
Response object
The response
parameter will always return a object;
{
"status": 8,
"message": "GPS activated"
}
All status
values can be found in navigator.geolocation.activator.returnStatus
for comparison.
If the GPS is not activated and the app has location permission, the user will be asked to accept it's activation, like the images below.