Add fix for moveToForeground. Requires new permission for Android 10

This commit is contained in:
Nathan Kerr
2020-06-08 12:19:04 -07:00
parent 5f50704564
commit 4d98947310
4 changed files with 33 additions and 1 deletions

View File

@@ -79,7 +79,9 @@ cordova.plugins.backgroundMode.un('EVENT', function);
## Android specifics
### Transit between application states
Android allows to programmatically move from foreground to background or vice versa.
Android allows to programmatically move from foreground to background or vice versa.
Note: starting with Android 10, you must request the "Draw on Top" permission from the user or the call to `moveToForeground` will silently fail. You can request it with `cordova.plugins.backgroundMode.requestForegroundPermission();`. This permission isn't necessary for `moveToBackground`
```js
cordova.plugins.backgroundMode.moveToBackground();