Ahmed ibrahim
Ahmed ibrahim

Reputation: 1175

Question about the flutter framework background service

I have some questions regarding the Flutter background service capabilities. Have anyone tried to work with background tasks? I want to implement a code in the background, i have used some packages to do this, but looks like they are all implemented the same way, for example in the background_fetch package you can run background tasks when your app is inactive or paused, and when your app is detached it will run the headless task, but if the app is closed (removed from recent apps) the headless task does not start. Is there any possible way to do the background task in this case? If not, is it possible to run a code in Flutter that runs before the app is terminated (removed from recent)? Or is there any possible ways around this?

Upvotes: 1

Views: 127

Answers (1)

madhead
madhead

Reputation: 33481

I think you could try native code binding (MethodChannels). There is an example in this article: https://dev.to/protium/flutter-background-services-19a4

Upvotes: 1

Related Questions