You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use this plugin for one of my use case. I need to run some processes in background when app (built in ionic 5 and angular 10) is minimize and screen is locked. I am using Samsung X cover Android 10 + version. Its working fine for longer period of time (approx. 14-15 hours) if I plugin my phone (USB cable charging on), minimize the App with screen lock but it does not give similar results if I unplug the phone from charger. App stop the background processes after 2-3 hours.
Can you please advice here?
Below is the code implemented ->
On device platform ready => below code is written
this.background.setDefaults();
this.background.enable();
this.background.on('activate').subscribe(() => {
this.background.disableWebViewOptimizations();
this.background.disableBatteryOptimizations();
});
I tried using "cordova-plugin-power-optimization": "0.0.4" => this.powerOptimization.RequestOptimizations();
this.powerOptimization.IsIgnoringBatteryOptimizations();
along with above options.
Permissions are set in my AndroidManifest.xml file such as -
android.permission.WAKE_LOCK,
android.permission.FOREGROUND_SERVICE
android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
Using latest versions of backgroundmode plugin - "cordova-plugin-background-mode": "^0.7.3",
The text was updated successfully, but these errors were encountered:
I am trying to use this plugin for one of my use case. I need to run some processes in background when app (built in ionic 5 and angular 10) is minimize and screen is locked. I am using Samsung X cover Android 10 + version. Its working fine for longer period of time (approx. 14-15 hours) if I plugin my phone (USB cable charging on), minimize the App with screen lock but it does not give similar results if I unplug the phone from charger. App stop the background processes after 2-3 hours.
Can you please advice here?
Below is the code implemented ->
On device platform ready => below code is written
this.background.setDefaults();
this.background.enable();
this.background.on('activate').subscribe(() => {
this.background.disableWebViewOptimizations();
this.background.disableBatteryOptimizations();
});
I tried using "cordova-plugin-power-optimization": "0.0.4" => this.powerOptimization.RequestOptimizations();
this.powerOptimization.IsIgnoringBatteryOptimizations();
along with above options.
Permissions are set in my AndroidManifest.xml file such as -
android.permission.WAKE_LOCK,
android.permission.FOREGROUND_SERVICE
android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
Using latest versions of backgroundmode plugin - "cordova-plugin-background-mode": "^0.7.3",
The text was updated successfully, but these errors were encountered: