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

@@ -252,6 +252,17 @@ exports.moveToForeground = function()
}
};
/**
* Requests permission to "draw on top" which is necessary for the "moveToForeground" method in Android 10+
*
* @return [ Void ]
*/
exports.requestForegroundPermission = function() {
if (this._isAndroid) {
cordova.exec(null, null, 'BackgroundModeExt', 'requestTopPermissions', []);
}
};
/**
* Exclude the app from the recent tasks list (Android only).
*