Reputation: 59
I want to execute some background task in Flutter when the app is not in opened state. It is either in background or in terminated state. The requirement is that i want to fetch the device location after regular intervals say 15 minutes and send it to server. After researching quite a lot, I found workmanager package for flutter for the same purpose. It works for Android (not perfectly because of some battery restrictions) but it does not work for iOS. Periodic tasks are not handled for iOS in this package and only One Off task works. However this package was quite close to my requirement while others cant. I have tried a lot available packages. So I am left with two options:
Upvotes: 4
Views: 2106
Reputation: 117
There is two ways
backgorund tasks (not very efficient) https://developer.apple.com/documentation/backgroundtasks
silent pushes, client needs to have pushes notifications activated. But, you can manage update intervals with your backend like you want
Upvotes: 0