Skip to content

Commit

Permalink
Add setEnabled function
Browse files Browse the repository at this point in the history
  • Loading branch information
katzer committed Jan 19, 2017
1 parent ca3530d commit e2a8ab0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions www/background-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit e2a8ab0

Please sign in to comment.