Add wakeUp and unlock functions

This commit is contained in:
Sebastián Katzer
2017-02-10 13:10:46 +01:00
parent ff9f06382f
commit 0f94708c7a
6 changed files with 162 additions and 27 deletions

View File

@@ -125,6 +125,16 @@ cordova.plugins.backgroundMode.isScreenOff(function(bool) {
});
```
### Unlock and wake-up
A wake-up turns on the screen while unlocking moves the app to foreground even the device is locked.
```js
// Turn screen on
cordova.plugins.backgroundMode.wakeUp();
// Turn screen on and show app even locked
cordova.plugins.backgroundMode.unlock();
```
### Notification
To indicate that the app is executing tasks in background and being paused would disrupt the user, the plug-in has to create a notification while in background - like a download progress bar.