Add setEnabled function

This commit is contained in:
Sebastián Katzer 2017-01-19 10:56:26 +01:00
parent ca3530d232
commit e2a8ab038a

View File

@ -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.
* *