fluttercommunity / flutter_workmanager

A Flutter plugin which allows you to execute code in the background on Android and iOS.
851 stars 260 forks source link

🐞Android: terminating leads to stop background task #480

Closed themw123 closed 1 year ago

themw123 commented 1 year ago

Version

Technology Version
Workmanager version 0.5.1
Flutter version 3.10.2
S10e 12
A52 13
s23 Ultra 13

On some devices(galaxy s10e and A52) it is fine terminating the app with a swipe. The background task will continue. On other devices(s23 ultra) it wont continue background task if terminating the app with a swipe. On all devices i am requesting and accepting Permission.ignoreBatteryOptimizations. If i dont request for this permission it wont work even on galaxy s10e and A52, i think because of the fact that power saving mode is enabled.

I am using the example code from readme

ened commented 1 year ago

This is unfortunately expected. Different versions of Android behave differently.