0.2.2 • Published 5 years ago

cordova-plugin-gps v0.2.2

Weekly downloads
6
License
ISC
Repository
github
Last release
5 years ago

Cordova Plugin Gps

This plugin allows to turn on the gps if that is disabled. If gps is disabled it will show a dialog: by press OK button the app will be able to turn on the GPS.

Platform Available

Only Android

Installation

Install it with npm.

npm i cordova-plugin-gps

How To Use

Simple Use

Call enableGps method in your js.

    // Example of Use
    cordova.plugins.cordovaplugingps.enableGps(function(enabled){
        // User can press ok or not
        if (enabled) {
            alert("Gps enabled!");
        } else {
            alert("Gps disabled!");
        }
    }, function(err) {
        alert('An error occurred: ' + err);
    });

Force to active / Recursive Request

    function requestGpsActivation () {
        // Example of Use
        cordova.plugins.cordovaplugingps.enableGps(function(enabled){
            // User can press ok or not
            if (enabled) {
                alert("Gps enabled!");
            } else {
                requestGpsActivation();
            }
        }, function(err) {
            alert('An error occurred: ' + err);
        });
    }    

    requestGpsActivation();

Author

Daniele Tulone

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.1

5 years ago