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:
- Either provide the package for the same requirement. (I have tried almost all of them)
- Another way is to write some native IOS in Swift and inject it into my flutter using method channel. I haven't worked with iOS. So I want full working code for the same. If someone does not know Flutter, then provide me the working native ios code in swift.
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