I am new to flutter.
I want to build a map application that shows collectable items on a map. When the users are near the item they can collect them. I have to make call to server to indicate that user collect the item.
I understand the application will function when it is in the foreground. But if the application is in the background can it perform these functions? For example: update users location, get items based on the location, collect items etc.
Does flutter can perform these functions normally if it is in the background or we have to create say some service type of application to do this?
I appreciate any advice regarding this.
CodePudding user response:
Yes, you can do it, but you will need to create this methods with kotlin / java and use the platform channels to invoke it.
CodePudding user response:
Yes you can workmanger is for running something on the background in your flutter app and it supports dart directly Workmanager. Alternatively native code will work for you swift or objective-c for ios and kotlin or java for android depending on which default native languages you tell flutter to create project with but that becomes very complex especially over ios side if you have no prior experience. Try your best with workmanager see if that can work.
Put a look to firebase schedule functions and cron as well see if they can do the job as well for you
Firebase Schedule Functions
Cron Flutter