cordova-plugin-background-mode
cordova-plugin-background-mode copied to clipboard
it crashed when running on some android 9 devices
it running well on my phone,but others can not working when switch to other app,it crashed when switch to other app,the system give tip the app is stop running
Same here. It's crashing on phone using android 9, but not crashing on emulator android version 9.
its not only android 9 even on android 10 its crashing when task switched , it has to be some permission issues probably
for right now when i use this.backgroundMode.setDefaults({ silent: true });
the app wont crash atleast. but this needs fixing imo.
same here. I use Android 10 device and I write code like
this.platform.ready().then(() => {
this.backgroundMode.enable();
this.backgroundMode.overrideBackButton();
...
}
It crashes when I return to the foreground of the app!
Same here.
Do you have any ideas?
Do you have any ideas?
I don't use this.backgroundMode.enable();
Instead, I override backButton and use this.backgroundMode.moveToBackground();
and it works.
@jerryaner- sir are u fixed above issue, actually I got same issue?
@kapilSoni101 you can work around the problem, checking the android version and only enabling the backgroud if the version is equal to or less than 8.0. It is not the best solution!
@mauriliosfc: ok bro I will check and let u know thanks sir
Has anyone found the solution?
Has anyone found the solution?
as i stated above u can try this, for right now when i use this.backgroundMode.setDefaults({ silent: true });
the app wont crash at least. but this needs fixing imo.
Without the plugin, my app could stay in background for 5 to 10 seconds and could even receive push notifications...When I installed the plugin, my app is killed right after going to background. I have the following setup:
cordova.plugins.backgroundMode.enable();
cordova.plugins.backgroundMode.setDefaults({ silent: true }); // was set to prevent app from crashing while in background as I was experiencing that as well
cordova.plugins.backgroundMode.on('activate', function () {
setInterval(function () {
cordova.plugins.notification.badge.increase();
}, 1000);
});
cordova.plugins.backgroundMode.on('deactivate', function () {
cordova.plugins.notification.badge.clear();
});
Any help?
austyking Hello
Author file
This code should be added when mentioning binding activation
cordova.plugins.backgroundMode.disableWebViewOptimizations();
example:
cordova.plugins.backgroundMode.enable();
cordova.plugins.backgroundMode.setDefaults({ silent: true });
cordova.plugins.backgroundMode.overrideBackButton();
cordova.plugins.backgroundMode.wakeUp();
cordova.plugins.backgroundMode.unlock();
cordova.plugins.backgroundMode.on('activate', function () {
cordova.plugins.backgroundMode.disableWebViewOptimizations();
window.setInte = setInterval(function () {
calllog_check();
btn_sms();
}, 15000);
});
cordova.plugins.backgroundMode.on('deactivate', function () {
clearInterval(window.setInte);
});
After running for 24 hours on Android 10
no problem
My english is not good, please forgive me
Come to Taiwan NEO
web:3cc.cc
@Mate20x can you help me ?