I have been trying a couple of solutions to get a a small task to send the phone's GPS location to my backend, and yours seems to be the most advanced / with less weird configuration.
However, I haven't been able to get any of those (including yours) to work.
From a brand new Flutter project, using the example main.dart and following the installation process, I cannot get any background task to show anything...
I must be missing something but I cannot figure out why.
ios
I checked your repo and opened your example/ app, and compiled. This is what I get (same on an Android physical device):
It looks like I have the right capabilities set:
Also, I get this in the terminal:
Upgrading Info.plist
Removing script build phase dependency analysis.
Warning: Missing build name (CFBundleShortVersionString).
Warning: Missing build number (CFBundleVersion).
Action Required: You must set a build name and number in the pubspec.yaml file version field before submitting to the App Store.
Running pod install...
Running Xcode build...
Xcode build done. 29.9s
Debug service listening on ws://127.0.0.1:58718/bEmS5JoxNMY=/ws
Syncing files to device iPhone 14 Pro Max...
flutter: To simulate the refresh task you can use next command: "e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@"com.dsr_corporation.task1"]"
But I have no idea what the command does, and if I run it I get:
$> e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@"taskID"]
zsh: bad pattern: (void)[[BGTaskScheduler
Any idea?
Android
I got it working and I could see the task sending messages in the terminal, however as soon as I closed my app, the task seemed to terminate:
I/flutter (23101): refresh 0:00:19.164256
I/flutter (23101): refresh 0:00:20.179155
I/flutter (23101): end refresh task
I/WM-WorkerWrapper(23101): Worker result SUCCESS for Work [ id=1d39c6a7-db71-453e-a796-ed6078505dc2, tags={ com.dsr_corporation.flutter_background_executor.workers.FlutterBackgroundExecutorWorker } ]
Thanks a lot for the awesome work!
I have been trying a couple of solutions to get a a small task to send the phone's GPS location to my backend, and yours seems to be the most advanced / with less weird configuration.
However, I haven't been able to get any of those (including yours) to work.
From a brand new Flutter project, using the example
main.dart
and following the installation process, I cannot get any background task to show anything...I must be missing something but I cannot figure out why.
ios
I checked your repo and opened your
example/
app, and compiled. This is what I get (same on an Android physical device):It looks like I have the right capabilities set:
Also, I get this in the terminal:
But I have no idea what the command does, and if I run it I get:
Any idea?
Android
I got it working and I could see the task sending messages in the terminal, however as soon as I closed my app, the task seemed to terminate:
So I could not have it run in the background...
Am I missing something?