mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2025-12-13 09:53:22 +00:00
Enable geo location tracking in background [Fixes #186]
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user