cordova-plugin-background-mode
cordova-plugin-background-mode copied to clipboard
Android 9 don't work
HI! i' have a phonegap application and for android-targetSdkVersion 27 works well. For android-targetSdkVersion 28 crash with background plugin. I put permissions in my config.xlm and dosen't work. Any someone have a solution?
config.xlm Head: `
<platform name="android">
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:usesCleartextTraffic="true" />
</edit-config>
</platform>
<platform name="android">
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
</edit-config>
</platform>`
This plugin doesn't update anymore. https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background/src/master/ this fork works on android 9.
What is the change compared to this version?
This one works for me https://www.npmjs.com/package/cordova-plugin-background-mode-fixed
On both IOS and Android? I have been testing a lot, and it seems that on Android it works for some time 5+ hours and then it suddenly stops for no apparent reason
Only on Android, I only use it for a simple timer app and didn't test it for more than a few minutes
Could be interesting if you could test it running 24 hours
I think it is also related to what device you are using. https://dontkillmyapp.com/
I tried running it for 24 hours, it crashed after about 6. I'm using a Huawei phone, so that might be the reason
It seems to be webview that is the problem. I have had an android native application running in the background for 3+ days now. But when starting the backgroundservice from a webview I ndver have seen it running more than 6-8 hours
It seems to be webview that is the problem. I have had an android native application running in the background for 3+ days now. But when starting the backgroundservice from a webview I ndver have seen it running more than 6-8 hours
So the Plugin is Buggy.
This plugin doesn't update anymore. https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background/src/master/ this fork works on android 9.
Ok but this new plugin are compatible whith phonegap?
I am using the plugin https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background/src/master/ and it has the same problems. It is working fine for some hours, then it stops
@JohannesPertl @ThorvaldAagaard it should work properly if this was used in your tests:
cordova.plugins.backgroundMode.on('activate', function() {
cordova.plugins.backgroundMode.disableWebViewOptimizations();
});