Enable geo location tracking in background [Fixes #186]

This commit is contained in:
Sebastián Katzer
2017-01-01 18:48:06 +01:00
parent bb72a5e8c8
commit 8e3a3528ac
2 changed files with 72 additions and 15 deletions

View File

@@ -90,6 +90,15 @@ exports.configure = function (options) {
}
};
/**
* Enable GPS-tracking in background (Android).
*/
exports.enableGeoLocation = function () {
if (device.platform == 'Android') {
cordova.exec(null, null, 'BackgroundMode', 'enableGeoLocation', []);
}
};
/**
* If the mode is enabled or disabled.
*