I am using WorkManager for Background Service. My code is as follows
void callbackDispatcher() {
Workmanager.executeTask((task, inputData) async {
switch (task) {
case "uploadLocalData":
print("this method was called from background!");
await BackgroundProcessHandler().uploadLocalData();
print("background Executed!");
return true;
break;
case Workmanager.iOSBackgroundTask:
print("iOS background fetch delegate ran");
return true;
break;
}
return false;
});
}
is there any way to wait for async method in executeTask ?