forked from Github/cordova-plugin-run-in-background
Add fix for moveToForeground. Requires new permission for Android 10
This commit is contained in:
@@ -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).
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user