mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2025-12-13 09:53:22 +00:00
New "disableBatteryOptimizations" function for Android
This commit is contained in:
@@ -160,7 +160,20 @@ exports.disableWebViewOptimizations = function()
|
||||
{
|
||||
if (this._isAndroid)
|
||||
{
|
||||
cordova.exec(null, null, 'BackgroundMode', 'optimizations', []);
|
||||
cordova.exec(null, null, 'BackgroundMode', 'webviewoptimizations', []);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Disables battery optimazation mode for the app.
|
||||
*
|
||||
* @return [ Void ]
|
||||
*/
|
||||
exports.disableBatteryOptimizations = function()
|
||||
{
|
||||
if (this._isAndroid)
|
||||
{
|
||||
cordova.exec(null, null, 'BackgroundMode', 'batteryoptimizations', []);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user