here my problem:
app does’t work after +/- 3 hours after the screen is turned off.
i have a issue with an ionic 3 app, my app use a timer to check something on server every 3 seconds so that work fine, but when the screen is turned off after +/- 3h my app doesn’t work anymore it stop sending request, i think it enter in Doze and App Standby MODE AND system prevent it from using network and other resources.
after some search on forum i found this :
i integrated the some code in my app here is the code:
initializeApp() {
this.platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
this.statusBar.styleLightContent();
this.splashScreen.hide();
//config language
this.getAppLanguage();
this.backgroundMode.enable();
this.powerManagement.dim().then(() => {
console.log('-------$$------- Wakelock acquired -------$$-------');
})
.catch(() => {
console.log('-------$$------- Failed to acquire wakelock -------$$-------');
});
this.powerManagement.setReleaseOnPause(false).then(() => {
console.log('-------$$------- setReleaseOnPause successfully -------$$-------');
})
.catch(() => {
console.log(' -------$$------- Failed to set -------$$-------');
});
});
}