mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2025-12-13 01:43:24 +00:00
New method isActive to receive if mode is active
This commit is contained in:
@@ -29,7 +29,7 @@ document.addEventListener('backbutton', function () {}, false);
|
||||
// Called before 'deviceready' listener will be called
|
||||
channel.onCordovaReady.subscribe(function () {
|
||||
// Device plugin is ready now
|
||||
channel.onCordovaInfoReady.subscribe( function () {
|
||||
channel.onCordovaInfoReady.subscribe(function () {
|
||||
// Set the defaults
|
||||
exports.setDefaults({});
|
||||
});
|
||||
@@ -44,10 +44,17 @@ channel.onCordovaReady.subscribe(function () {
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* Flag indicated if the mod is enabled.
|
||||
* Flag indicated if the mode is enabled.
|
||||
*/
|
||||
exports._isEnabled = true;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* Flag indicated if the mode is active.
|
||||
*/
|
||||
exports._isActive = true;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
@@ -125,7 +132,7 @@ exports.configure = function (options) {
|
||||
};
|
||||
|
||||
/**
|
||||
* If the mode is enabled or not.
|
||||
* If the mode is enabled or disabled.
|
||||
*
|
||||
* @return {Boolean}
|
||||
*/
|
||||
@@ -133,6 +140,15 @@ exports.isEnabled = function () {
|
||||
return this._isEnabled;
|
||||
};
|
||||
|
||||
/**
|
||||
* If the mode is active.
|
||||
*
|
||||
* @return {Boolean}
|
||||
*/
|
||||
exports.isActive = function () {
|
||||
return this._isActive;
|
||||
};
|
||||
|
||||
/**
|
||||
* Called when the background mode has been activated.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user