mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2024-11-15 03:54:54 +00:00
Add setEnabled
function
This commit is contained in:
parent
ca3530d232
commit
e2a8ab038a
@ -60,6 +60,21 @@ exports.disable = function () {
|
|||||||
cordova.exec(fn, null, 'BackgroundMode', 'disable', []);
|
cordova.exec(fn, null, 'BackgroundMode', 'disable', []);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable or disable the background mode.
|
||||||
|
*
|
||||||
|
* @param [ Bool ] enable The status to set for.
|
||||||
|
*
|
||||||
|
* @return [ Void ]
|
||||||
|
*/
|
||||||
|
exports.setEnabled = function (enable) {
|
||||||
|
if (enable) {
|
||||||
|
this.enable();
|
||||||
|
} else {
|
||||||
|
this.disable();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of all available options with their default value.
|
* List of all available options with their default value.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user