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

Background services when app is close #33

Closed RobotMaths closed 2 years ago

RobotMaths commented 3 years ago

Hi, the plugin is working well, I have nothing to say. However, when I close the app (swipe up) from the app menu of android, this don't still work. Is this plugin handle this ? What can I do to run my app 24/24 even if the user close it ?

Thx !

JulianAssmann commented 2 years ago

Thank you :)

What would be your use case for this?

In general, I don't think this is possible. When the user closes an app, the process is killed and therefore no Dart code gets executed anymore. When this happens, this plugin stops the foreground service as well (as implemented in version 0.1.3, see here).

It seems that you can restart a foreground service via a broadcast receiver (see here), but I think that this behaviour would be annoying for the user and I don't know if there is any use case for that.

JulianAssmann commented 2 years ago

Closing due to inactivity. Please feel free to reopen this issue again at any time.