Hello Readers,
Cordova Geolocation API works when GPS enabled on device or we can say that it will not provide you the exact position. We can provide manual lat long with out enable GPS. Cordova Geolocation API doesn't provide a way to check GPS enabled or not.
Now we have a plugin which checks GPS enable or not and we can notify user to enable the GPS.
This plugin supports Android and iOS platform.
To install the plugin we need to install the plugin through CLI :
$ cordova plugin add https://github.com/fastrde/phonegap-checkGPS.git
Now we can check GPS enabled or not.
Example:
CheckGPS.check(function(){
alert("GPS is enabled!");
},
function(){
alert("GPS is disabled!");
});
Plugin creates CheckGPS object with check method which checks the GPS settings on device.
Hope this will help you :)
0 Comment(s)