Open vicenterusso opened 3 years ago
I think the problem is from iOS, because the background process doesn't work the same way as android's WorkManager. The iOS still decides when to call your task :( and will not trigger immediately after all conditions are met as with the WorkManager.
There are example commands in the repo which you can use to force trigger the background event on iOS https://github.com/xinthink/flt_worker/blob/master/example/lib/main.dart
Here is the documentation from apple : https://developer.apple.com/documentation/backgroundtasks/starting_and_terminating_tasks_during_development
I have tested it as registered an event , then kill the app and run it again from XCode with break point in the application class(after plugin registration). While the code is stopped on the break point, put in the console one of the commands from the main.dart and resume the app. My callback writes many logs, basically after each row so I can see what has been done.
I think that this approach works on real devices only though.
However, another drawback is that you still have a limited time and if you are uploading 20 images may still not be enough to finish.
I cloned the repo and started the example on ios simulator. Apparently nothing happened when I click the buttons, no error, no exceptions, no value being changed.