[Ionic-4] How to exclude my ionic app from the android Battery Optimization

Hi there, just an update for whoever is following this thread.

I’ve also tried the steps described here (I found a solution for some regular background activity!) but my app is still going off after a while.

Here my last setup, code in the “app.component.ts”:

[...]
this.backgroundMode.enable();
this.powerManagement.dim();
this.powerManagement.setReleaseOnPause(false);
[...]

My AndroidManifest.xml contains also

[...]
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
[...]

Thanks again.