diff --git a/plugin.xml b/plugin.xml index 52bd90e..004c203 100644 --- a/plugin.xml +++ b/plugin.xml @@ -75,6 +75,7 @@ + webView.loadUrl("javascript:" + js)); } - } diff --git a/src/android/ForegroundService.java b/src/android/ForegroundService.java index 0544192..4e4aa8f 100644 --- a/src/android/ForegroundService.java +++ b/src/android/ForegroundService.java @@ -320,5 +320,4 @@ public class ForegroundService extends Service { { return (NotificationManager) getSystemService(NOTIFICATION_SERVICE); } - } diff --git a/www/background-mode.js b/www/background-mode.js index 85f9b50..37e6a18 100644 --- a/www/background-mode.js +++ b/www/background-mode.js @@ -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', []); } };