diff --git a/www/background-mode.js b/www/background-mode.js index a51afbf..8dcc3f9 100644 --- a/www/background-mode.js +++ b/www/background-mode.js @@ -60,6 +60,21 @@ exports.disable = function () { 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. *