transistorsoft/flutter_background_fetch

How to unregister the HeadlessTask that was registered?

Closed this issue · 2 comments

zzzh commented

Is your feature request related to a problem? Please describe.
I tried to use background_fetch in an app to see how it works, though, after that, when I run another app that don't use it, the headlessTask would keep running.

Describe the solution you'd like
unregister the HeadlessTask used to be registered using registerHeadlessTask.

Describe alternatives you've considered
Set enableHeadless to false and stopOnTerminate to true in configure seems to work too, but not looks like a clean way.

Additional context
Nothing here.

but not looks like a clean way.

That is the only way.

zzzh commented

but not looks like a clean way.

That is the only way.

Ok, I got it, thank you.