Does flutter_background_geolocation fetch the location even when app is killed?

199

Solution 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.

Solution 2

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.

Share:
199
Mohamed El Hadramy Oumar
Author by

Mohamed El Hadramy Oumar

Updated on January 04, 2023

Comments

  • Mohamed El Hadramy Oumar
    Mohamed El Hadramy Oumar over 1 year

    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?

    • Srujan Chowdary Panda
      Srujan Chowdary Panda almost 2 years
      Facing few issues in working with background_locator. Can you provide me with a working example for tracking background location which you're using!? reference: stackoverflow.com/questions/72246232/…
  • Mohamed El Hadramy Oumar
    Mohamed El Hadramy Oumar almost 2 years
    it provides a pretty good documentation