JulianAssmann / flutter_background

A flutter plugin to keep apps running in the background via foreground services. Android only.
https://pub.dev/packages/flutter_background
MIT License
86 stars 46 forks source link

[BUG] Background work only 6min exactly #26

Closed nitneuq33 closed 2 years ago

nitneuq33 commented 3 years ago

Hello, I tried during long weeks to make works a flutter app in background, and I test this plugin with lot of hope. But it work only several minutes. After 6minutes my logic loop in a timer and I can’t go out. I need to reboot device or rebuild app to rework 6min. I respect manifest permission. I accept battery permission when I test. Weird things, when I’m plug-in ( powered by cable) it works with no limite of time but when I’m not plug and screen off, It work only 6min and if I’m not plug but screen on, it works with no limite of time...

JulianAssmann commented 3 years ago

This bug probably happens for the same reason as in #9.

Different OEMs have different policies on background execution in Android and modify the behaviou of the OS in this regard. This also would explain that the app works without any issue when plugged in, as there is no need to conserve energy in this case. You seem to have a rather aggressive OEM policy on your device.

Do you have any stacktrace or log of the crash?