How to run long task while flutter app is in background

1.2k Views Asked by At

I'm looking for a way to run dart code in the background when my app is active and continue it when the app is put in the background or is terminated.

I will make many API call and database management. This task could take 10min to 45min or more if the user has a bad network. My users need to see the task progression, so when a task is launched, I would see its execution immediately.

I've tested flutter isolates, but it seems that they are paused/terminated when the app is paused or killed by the system or by the user.

I've tested flutter_workmanager but in iOS background processing only run in background and stop when the app goes in foreground. In addition, the system decides the best moment to run the callback launched by my code... So my user can start the task and never see it begin...

What can I test now :'( ?

(I'm curious to heard answers even if it's in native: kotlin, Swift)

0

There are 0 best solutions below