3

I’ve been using background_locator to fetch the location of the user in the background even when app is killed. To be honest, it’s the only package that worked for me. Now this package is not reliable after using for months and the maintainer doesn’t publish updates often.

I’m look for alternative. Is flutter_background_geolocation a true alternative?

1

2 Answers 2

1

I’m the author of this plugin.

Yes, if you configure stopOnTerminate: true.

Android Headless Mode (enableHeadless: true) is optional, required only if you have custom business logic. The SDK’s built-in http service can automatically upload each recorded location to your server without a headless-task.

iOS will resume tracking after the device moves ~200 meters beyond last known location, when the OS automatically re-launches your app in the background, just as if launched from the home screen.

Have a look at the API docs linked at the top of the GitHub repo README, they’ quite extensive.

4
  • 2
    How do I send the data periodically to the socket using HTTP method? Commented Aug 26, 2022 at 6:27
  • @SheetalGhori, found an answer? Commented Oct 30, 2022 at 19:06
  • Not yet, As of now I set a timer.periodic while app is terminated @KizatSuleimenov Commented Oct 31, 2022 at 3:42
  • Please explain the package behavior for iOS when app is terminated. I need my application to track user location on iOS even when app is closed. I have headless task registered on main. However, I know that headless mode works only for android.I do have a home screen with all functions onLocation, onProvider, etc. I am not sure how will the location of the user for iOS would still be tracked even when app is killed/ closed as all of the logic for this resides in the home screen. Commented Oct 17, 2023 at 19:08
1

It does work even when the app is terminated. it is called headless mode in android. I have tested in android and seems to work so far.

Android Headless Mode Flutter Background Geolocation

I havent't tested in iOS yet.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.