katzer / cordova-plugin-background-mode

Keep app running in background
Apache License 2.0
1.38k stars 1.02k forks source link

App is crashed when moving to background when using a foreground icon #583

Open Taxi4you opened 1 year ago

Taxi4you commented 1 year ago

If you don't configure this:

cordova.plugins.backgroundMode.setDefaults({ silent: true })

Then when you move to background the app is crashing immediately on Android 10 +. However the plugin creator says that a foreground service icon is highly recommended and that it can be found under platforms/android/res/drawble/icon.png.

Well I have added an icon for there and still it doesn't work.

justingreenwoodcstg commented 1 year ago

There are a number of PR's here that you can apply that may fix your issue. This plugin isn't maintained and there are almost 1000 forks now. I have the plugin almost working, but now that I'm using capacitor, my app still falls asleep in the background, unpredictably. I believe that there is something different with capacitor than there was with cordova that might be causing this headache, because even the older versions of android that used to work with the plugin, don't work anymore.