cordova-plugin-background-mode
cordova-plugin-background-mode copied to clipboard
The app is "restarted" when I move it to background
Hi! Im creating an app and I need to keep working in background but this doesnt work. I am on Visual studio with ionic, so I execute:
ionic cordova run android
The app is launched and working. The first view is a Login, I fill the login and this take me to the second view (that is a tab page). On this page I add:
constructor(private background: BackgroundMode){
this.background.enable();
console.log(this.background.isEnable());
console.log(this.background.isActive());
this.background.moveToBackground();
}
The problem is that when is moved to the background the app is "restarted". It means that when I open the app on background it takes me again to the first view where I should do the Login. So this is not working.
Am I doing something wrong? Is visual studio? How can I solve it?
Thanks!
Hi. Try it after moveToBackground()
this.backgroundMode.overrideBackButton()
Could you try: https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background/src/master/
I got the same situation, is there anyone who had solved this problem? Hope anyone can help me