mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2025-12-13 09:53:22 +00:00
Add wakeUp and unlock functions
This commit is contained in:
@@ -196,6 +196,28 @@ exports.isScreenOff = function (fn) {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Wake up the device.
|
||||
*
|
||||
* @return [ Void ]
|
||||
*/
|
||||
exports.wakeUp = function () {
|
||||
if (this._isAndroid) {
|
||||
cordova.exec(null, null, 'BackgroundMode', 'wakeup', []);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Wake up and unlock the device.
|
||||
*
|
||||
* @return [ Void ]
|
||||
*/
|
||||
exports.unlock = function () {
|
||||
if (this._isAndroid) {
|
||||
cordova.exec(null, null, 'BackgroundMode', 'unlock', []);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* If the mode is enabled or disabled.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user