PackageTrack
Sign in Get early access

flutter_background_geolocation

The most sophisticated background location tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android.

5.5.0 36K downloads/mo #1697 most downloaded on pub.dev transistorsoft/flutter_background_geolocation

What this package is like to depend on

Last release 1 months ago

24 Jul 2026

Ships fairly regularly

a new release about every 3 weeks

Most releases are documented

notes for 147 of 166 stable releases

Nothing withdrawn

no release was ever pulled

8 years old

187 releases · first in 2018

24 releases in the last 12 months

see the full history below

Release timeline

187 releases · Jul 2018 to Jul 2026
2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 60 of 187
  1. 5.5.0 24 Jul 2026
    Release notes

    Merge branch 'insertLocation'

    Open source →
    Release notes
    • [Fixed] insertLocation() now works — the supplied record is inserted as-given (import-as-is) and the returned Future resolves with the inserted record's uuid. It was previously unimplemented on iOS (the call never resolved) and on Android stored a record with an empty uuid (so destroyLocation() couldn't remove it) and an unvalidated timestamp. Timestamps are now normalized (ISO-8601 or epoch), and a uuid is generated when you don't provide one.
    • [Fixed][iOS] A location arriving with a future timestamp (device clock skew) could poison the internal last-location comparator, causing every subsequent location to be rejected until the app was restarted (stalled odometer, no location updates). Future-stamped fixes are now tolerated and the comparator self-heals. Android is unaffected.
    Open source →
  2. 5.4.0 12 Jul 2026
    Release notes
    • [Fixed][Android] Headless events permanently dropped after the app is relaunched and terminated a second time (FlutterJNI was detached from native C++ — regression introduced in 5.1.2). HeadlessTask.destroyBackgroundIsolate() destroyed the background FlutterEngine but left the headless registration state pointing at the dead engine, blocking a replacement isolate from ever booting. The registration state is now reset along with the engine, so the next headless event boots a fresh background isolate; events arriving during the teardown window remain queued and flush once it's ready.

    🛡️ Reduced Foreground-Service Usage (Android)

    Geofencing and activity recognition (motion detection) no longer require a foreground service. These modes now run without a persistent notification — ahead of Google Play's August 2026 policy that removes geofencing as an approved foreground-service location use-case.

    • Run without foreground-service permissions. You can remove FOREGROUND_SERVICE / FOREGROUND_SERVICE_LOCATION from your manifest. When absent, continuous location degrades gracefully to the OS significant-changes path (best-effort) instead of failing to start.
    • Quieter by default. Geofence-only and motion-only apps no longer show an ongoing notification.
    • Opt back in via config for apps that still need classic foreground-service delivery.

    Continuous high-frequency tracking (trackingMode: LOCATION) still uses a foreground service where permitted.

    • [Added] New getLocations([LocationQuery query]) method — page through the location database, eg getLocations(LocationQuery(limit: 500, page: 0, order: LocationQuery.ORDER_DESC)). The .locations getter is retained as an alias for the unbounded read. Fixes out-of-memory crashes when reading a database holding thousands of records.
    • [iOS] Pin TSLocationManager ~> 4.3.0
    • [Android] Pin tslocationmanager 4.3.+
    Open source →
  3. 5.3.0 22 Jun 2026
    Release notes

    Merge branch 'onLocationFilter'

    Open source →
    Release notes
    • [Added] New event onLocationFilter — fires when the tracking location-filter rejects a location (eg: horizontal accuracy worse than LocationFilter.trackingAccuracyThreshold, or a GPS spike under the Conservative policy: implausible implied-speed / statistical outlier). Rejected locations are not delivered to onLocation, so this is the only way to observe and adapt to them. The event provides the rejected location, a normalized reason ("low-accuracy" | "implied-speed" | "outlier-capped"), accuracy, and trackingAccuracyThreshold.
    • [iOS] Pin TSLocationManager ~> 4.2.0
    • [Android] Pin tslocationmanager 4.2.+
    Open source →
  4. 5.2.1 12 Jun 2026
    Release notes
    • [iOS] Pin TSLocationManager 4.1.10 — delivers the native fixes below.
    • [Android] Pin tslocationmanager 4.1.9 — delivers the native fixes below.
    • [Added] New config option LocationFilter.odometerPolicy — selects the filtering policy applied to odometer-relevant samples, independent of LocationFilter.policy. Defaults to adjust (existing behavior: anomalous samples are capped but still accumulated); use conservative to reject GPS teleports outright, eliminating phantom odometer distance on devices that emit corrupted location bursts.
    • [Fixed] Odometer under-counted the first motionchange location after exiting the stationary geofence: the Kalman filter restarted from a zero estimate, crediting only ~20% (Android) / ~1% (iOS) of the genuine exit distance (200–1000m). The filter now seeds from its first post-reset measurement, crediting the full gap distance.
    • [Fixed][iOS] LocationFilterPolicy.conservative rejected the first motionchange fix after a stationary-geofence exit as an outlier — the outlier bound was time-independent. Android parity: the bound now scales with elapsed time via the kinematic cap, so genuine post-gap fixes are accepted while teleports (dt ≈ 0) are still rejected.
    • [Fixed][iOS] Declare FlutterFramework dependency in the plugin's Package.swift, required by Flutter's Swift Package Manager integration (Flutter ≥ 3.38). Silences the missing-dependency warning at build time; CocoaPods consumers are unaffected.
    • [Changed][Android] geolocation.filter options now apply at runtime via setConfig without restarting tracking (parity with iOS).
    • [Changed] Example app — migrated the iOS Runner to the UIScene lifecycle (UIApplicationSceneManifest + FlutterImplicitEngineDelegate plugin registration), ahead of Apple's upcoming requirement.
    • [Changed] Minimum Flutter SDK raised to >=3.38.0 (aligned with background_fetch; required by the Swift Package Manager FlutterFramework integration).
    Open source →
  5. 5.2.0 14 May 2026
    Release notes
    • [Fixed][Android] watchPosition crashes — IntegerLong / IntegerDouble ClassCastException from Flutter MethodChannel type mapping, and incorrect Map response shape where Dart expected an int watchId.
    • [Fixed][Android] watchPosition @UiThread RuntimeException — EventSink.success() called from background thread pool; now posted to main thread via Handler(Looper.getMainLooper()).
    • [Added] New Subscription class — watchPosition and all on* event-listener methods now return a Subscription instance with a .remove() method for convenient listener teardown.
    • [Changed] Example app — added "Watch position" toggle to SpeedDial FAB menu.
    Open source →
  6. 5.1.2 20 Apr 2026
    Release notes
    • [Fixed][Android] App stuck on splash / logo after relaunch when the foreground service kept the process alive past Activity termination. Root cause: HeadlessTask's static background FlutterEngine was never destroyed, so on main Activity reattach the stale engine conflicted with the freshly attaching main engine's plugin channels. HeadlessTask.destroyBackgroundIsolate() now runs when BackgroundGeolocationModule.setActivity(activity) receives a non-null Activity, clearing the background engine before the main engine attaches.
    • [Changed] Example main.dart — added boot-trace print() milestones to make stuck-splash reproductions immediately identify the Dart boot stage that hangs.
    • [Changed] Example bumps background_fetch to ^1.6.2 for the sibling fix that surfaced once the background engine started being properly destroyed (MissingPluginException on com.transistorsoft/flutter_background_fetch/methods).
    Open source →
  7. 5.1.1 10 Apr 2026
    Release notes

    Merge branch 'timestampFormat'

    Open source →
    Release notes
    • [Added] New config option PersistenceConfig.timestampFormat — set to "epoch" to receive timestamp and recorded_at as epoch milliseconds (number) instead of the default ISO-8601 UTC strings.
    • [Fixed][Android] getCurrentPosition timeout (408) with approximate (COARSE-only) location permission. With only approximate location granted, the SDK now resolves immediately with the first available location instead of waiting for samples that won't arrive.
    Open source →
  8. 5.1.0 07 Apr 2026
    Release notes

    [Example] pin tslocationmanager 4.1.+

    Open source →
    Release notes

    🚀 Zero Third-Party Native Logging Dependencies

    The native TSLocationManager SDK no longer depends on any third-party logging frameworks on either platform:

    • [iOS] Removed CocoaLumberjack — replaced with a custom, zero-dependency SQLite-backed logger using os_log for console output.
    • [Android] Removed slf4j / logback-android — replaced with a custom SQLite-backed logger using the native Android Log API.

    This eliminates a long-standing source of dependency conflicts for apps that use these popular logging libraries at different versions. The SDK's logging behavior, output format, and emailLog / uploadLog functionality remain identical.

    • [iOS] Pin TSLocationManager ~> 4.1.0
    • [Android] Pin tslocationmanager 4.1.+
    Open source →
  9. 5.0.7 26 Mar 2026
    Release notes

    Merge branch 'release-5.0.7'

    Open source →
    Release notes
    • Fix Package.swift: bump ios min .v12
    Open source →
  10. 5.0.6 26 Mar 2026
    Release notes

    Merge branch 'release-5.0.6'

    Open source →
    Release notes
    • Fix Package.swift for SPM users. The package name is renamed BackgroundGeolocation
    Open source →
  11. 5.0.5 21 Feb 2026
    Release notes

    Merge branch 'location-filter-sparse-update'

    Open source →
    Release notes
    • Support sparse updates on LocationFilter
    Open source →
  12. 5.0.4 30 Jan 2026
    Release notes

    Merge branch 'release-5.0.4'

    Open source →
    Release notes
    • Fix bug in State parsing.
    Open source →
  13. 5.0.3 29 Jan 2026
    Release notes

    Merge branch 'release-5.0.3'

    Open source →
    Release notes
    • Add guards in dart Location model to handle receiving dummy location-data provided by setOdometer when the SDK is !state.enabled or location auth is denied. In this state, the SDK will simply zero the odometer, not caring about the location where that occured.
    Open source →
  14. 5.0.2 28 Jan 2026
    Release notes
    • [iOS] Fix bug in iOS License Validation Failure modal dialog interfering with React Native app launching. Change to less intrusive alert mechanism.
    • [iOS] Fix bug returning wrong data-structure to watchPosition callback.
    • [iOS] Fix first-launch issue with initial call to .start()..
    • [iOS] Fix config.authorization bug (refreshPayload and refreshHeaders being ignored).
    • [Android] Re-factor Android activity life-cycle management. It's all done internally within SDK now. No need for react-native plugin code to manually listen to Activity lifecycle and poke the SDK when interesting events happen.
    • Fix bug not respecting PersistenceConfig.geofenceTemplate
    • [iOS] Fix bug in setOdometer not resolving its Promise
    Open source →
  15. 5.0.1 15 Jan 2026
    Release notes
    • [iOS] Fix syntax error in Package.swift
    Open source →
  16. 5.0.0 14 Jan 2026
    Release notes
    Open source →
  17. 5.0.0-beta.4 03 Dec 2025 pre-release
    Release notes
    • Fix type-cast bug in GeofenceEvent while in headless-mode.
    Open source →
  18. 5.0.0-beta.3 02 Dec 2025 pre-release
    Release notes
    • [Android] Add proguard rules to preserve flutter plugin classnames (eg: HeadlessTask) in release with minifyEnabled.
    Open source →
  19. 5.0.0-beta.2 24 Nov 2025 pre-release
    Release notes
    • Bug fixes.
    • [Android] Add guards against spurious geofence exit events reported with certain devices.
    Open source →
  20. 5.0.0-beta.1 10 Nov 2025 pre-release
    Release notes
    Open source →
  21. 4.18.3 14 Jan 2026
    Release notes
    • [Android] Backport spurious stationary geofence exit detection from v5. Google Play Services seems to have a bug where geofence exit events fire even while the device is still inside the geofence, causing the SDK to constantly enter the m oving state, draining the battery
    Open source →
  22. 4.18.2 29 Nov 2025
    Release notes
    • [Android] Rebuild with Android ELF Alignment
    Open source →
  23. 4.18.1 09 Nov 2025
    Release notes
    • [Android] pin tslocationmanager at 3.+ in preparation for next release..
    Open source →
  24. 4.18.0 08 Sep 2025
    Release notes
    • [Android] Remove Huawei HMS support for failure to provide their SDKs with Android 16KB Page Size compatibility.
    Open source →
  25. 4.17.1 25 Aug 2025
    Release notes
    • Fix example/pubspec.yaml enable-swift-package-manager: true
    Open source →
  26. 4.17.0 30 Jul 2025
    Release notes
    • [iOS] Implement Swift Package Manager support
    • [example] Re-factor /example app's location marker images.
    Open source →
  27. 4.16.12 07 Jul 2025
    Release notes
    • [Android] Rebuild tslocationmanager with AGP >= 8.5.1
    • [example] Update example's flutter_map to latest 8.1.1
    • [Android] Implement behaviour for locationAuthorizationRequest: "Any" to not continue showing backgroundPermissionRationale after user clicks [CANCEL] button.
    Open source →
  28. 4.16.11 16 Jun 2025
    Release notes
    • [Android] Fix issue with polygon geofencing where identifier consists of long strings, such as aaaa-bbbb-cccccccc-dddd-eeeee eeeeeee.
    • [Android] Fix edge-case where polygons can fail to fire after the containing geofence is exited. This could happen if the containing geofence was exited without trigger an onMotionChange event.
    • [iOS] Fix edge-case where polygon could fail to fire EXIT event after launching from terminated state when the containing geofence is exit causes background app restart.
    Open source →
  29. 4.16.10 19 May 2025
    Release notes
    • [Android] Support 16KB pages sizes.
    • [iOS] Fix ProviderChangeEvent.enabled not showing the result of global Privacy -> Location Services -> Enabled switch
    • [Android] Fix java.util.ConcurrentModificationException at com.transistorsoft.locationmanager.location.SingleLocationRequest.getBestLocation.
    Open source →
  30. 4.16.9 13 Feb 2025
    Release notes
    • [Android] Re-compile library with jdk 17
    Open source →
  31. 4.16.8 13 Feb 2025
    Release notes
    • [Android] Re-compile library with jdk 17 instead of 22
    Open source →
  32. 4.16.7 13 Feb 2025
    Release notes
    • [Android] Fix ConcurrentModificationException in StopTimeoutEvaluator.
    Open source →
  33. 4.16.6 19 Dec 2024
    Release notes
    • [Android] Address phenonenon of "UI Freezing".
    Open source →
  34. 4.16.5 03 Dec 2024
    Release notes
    • [Android] Remove Android Setup Step for proguard-rules.pro in your android/app/build.gradle. The SDK is now able to automatically apply its required proguard-rules.pro.
    Open source →
  35. 4.16.4 13 Nov 2024
    Release notes
    • [Android] Remove enforcement of minimum Geofence radius 150
    • [Android] Fix issue with TSLocationManagerActivity (responsible for showing location permission / authorization dialogs). Minimizing the app with an active permission dialog would cause the app's MainActivity to terminate on some devices.
    Open source →
  36. 4.16.3 08 Nov 2024
    Release notes
    • [Android] Fix reported "screen flickering" issue on some devices when SDK requests permissions.
    • [Android] Address Android synchronization issue with TSLocation.toMap.
    • [iOS] Address crash in TSConfig due to "uncaught exception NSInvalidArgumentException"
    • [Android] Change foregroundServiceType on LocationRequestService from shortService -> location.
    • [iOS] Address inconsistent location-tracking performance on iOS.
    Open source →
  37. 4.16.2 23 Oct 2024
    Release notes
    • [iOS] Fix bug with triggerActivites preventing motion-triggering in iOS simulator with simulated location.
    Open source →
  38. 4.16.1 23 Oct 2024
    Release notes
    • [Android] Implement Service.onTimeout to handle foregroundServiceType="shortService" timeouts.
    • [iOS] Add new Config.activityType ACTIVITY_TYPE_AIRBORNE.
    • [iOS] Implement Config.triggerActivities for iOS.
    • [Android] Guard against NullPointerException receiving a null location in PolygonGeofenceService event.
    • [Android] Remove unused imports related to Flutter V1 Embedding.
    • [Android] Address possible leak of Activity reference when terminating the app. Ensure internal reference to Activity is nullified when app is terminated.
    • [Android] Add improvements to Android geofencing-only mode with goefenceModeHighAccuracy: true where motion-activity updates disabled.
    • [Android] Add error-checking in polygon-geofencing to handle a possible NullPointerException.
    • [iOS] Fix broken linking to Settings screen in locationAuthorizationAlert on iOS 18.
    Open source →
  39. 4.16.0 04 Sep 2024
    Release notes
    • [iOS] Fix bug in iOS Polygon Geofencing when running in geofences-only mode (.startGeofences). iOS would mistakenly turn off location updates exactly 3 samples into the containing circular geofence of a polygon.
    • Implement notifyOnDwell for polygon-geofences.
    Open source →
  40. 4.15.5 14 Jun 2024
    Release notes
    • [Android] Remove permission FOREGROUND_SERVICE_HEALTH. It turns out that this permission is no longer required when the ActivityRecognitionServivce is defined with a foregroundServiceType="shortservice", which allows a background-launched foreground-service to stay active for up to 3 minutes, which is sufficient for the ActivityRecognitionService, which typically stays activated only for a few milliseconds.
    Open source →
  41. 4.15.4 05 Jun 2024
    Release notes
    • [Android] Fix issues #1298 "Multiple geofence events triggered for a single geofence registration when registered individually".
    Open source →
  42. 4.15.3 14 May 2024
    Release notes
    • [Android] Fix bug in .getCurrentPosition not returning or throwing an error in a condition where Network OFF and GPS ON.
    • Fix bug in .changePace exception-handling, throwing a FormatException instead of PlatformException.
    Open source →
  43. 4.15.2 22 Apr 2024
    Release notes
    • [iOS] Code-sign TSLocationManager.xcframework with new Apple Organization (9224-2932 Quebec Inc) certificate.
    Open source →
  44. 4.15.1 28 Mar 2024
    Release notes
    • [iOS] Add PrivacyInfo -> TSLocationManager.xcframework
    • [iOS] codesign TSLocationManager.xcframework
    • [iOS] Update CocoaLumberjack version -> 3.8.5 (version which includes its own PrivacyInfo) .
    Open source →
  45. 4.15.0 19 Mar 2024
    Release notes
    • [iOS] Implement new iOS Privacy Manifest
    • Add property AuthorizationEvent.status, provding the HTTP status code from the refreshUrl.
    Open source →
  46. 4.14.3 18 Mar 2024
    Release notes
    • [iOS] Fix bug in iOS scheduler, triggering ON incorrectly. For example, given a schedule: ['1 00:00-23:59'], the plugin was trigging on for DAY 2`.
    Open source →
  47. 4.14.2 14 Mar 2024
    Release notes
    • [iOS] Fix bug in polygon-geofencing: monitoredIdentifiers not being cleared when .removeGeofences() is called, can result in null-pointer exception.
    Open source →
  48. 4.14.1 12 Mar 2024
    Release notes
    • [Android] Change foregroundServiceType of the SDK's GeofencingService definition in its AndroidManifest from shortService -> location.
    Open source →
  49. 4.14.0 28 Feb 2024
    Release notes
    • [iOS] Modify behaviour of stop-detection system to NOT turn off location-services but merely adjust desiredAccuracy as high as possible. There were problems reported using locationAuthorizationRequest: 'WhenInUse' with recent versions of iOS where the stop-detection system could put the app to sleep during tracking if the motion API reported the device became momentarily stationary.
    Open source →
  50. 4.13.7 13 Feb 2024
    Release notes
    • Fix minor static analysis issues reported in dart code referencing part-of directive.
    Open source →
  51. 4.13.6 08 Feb 2024
    Release notes
    • [Android] Add multi FlutterEngine support to Android
    Open source →
  52. 4.13.5 16 Nov 2023
    Release notes
    • [Android] Fix problem with polygon-geofencing license-validation not working in DEBUG builds when configured with product flavors.
    Open source →
  53. 4.13.4 07 Nov 2023
    Release notes
    • [Android] HMS geolocation event does not provide a timestamp for the triggering location!! Use System current time.
    • [Android] Remove deprecated flutter V1 plugin architecture code (registerWith).
    • [Android] Guard against Geofence SQLite query returning null in GeofencingService.
    • [Android] Fix ConcurrentModificationException in SingleLocationRequest.getBestLocation
    Open source →
  54. 4.13.3 12 Oct 2023
    Release notes
    • [Android] Fix IllegalStateException calling addGeofences when number of geofences exceeds platform maximum (100).
    Open source →
  55. 4.13.2 05 Oct 2023
    Release notes
    • [Android] Fix error Unhandled Exception: type 'Null' is not a subtype of type 'List<Object?>' in BackgroundGeolocation.geofences / getGeofence(uuid).
    • [iOS] Rename iOS Obj-c classes, prefixing with TS.
    Open source →
  56. 4.13.1 02 Oct 2023
    Release notes
    • [iOS] Fix "Duplicate symbol error DummyPods_TSLocationManager".
    Open source →
  57. 4.13.0 28 Sep 2023
    Release notes
    • Polygon Geofencing: The Background Geolocation SDK now supports Polygon Geofences (Geofences of any shape). For more information, see API docs Geofence.vertices. ℹ️ Polygon Geofencing is sold as a separate add-on (fully functional in DEBUG builds).

    • Remove backup_rules.xml from AndroidManifest.xml — it's causing conflicts with other plugins.
    • [Android] Add proguard-rule for compilation of the android library to prevent from obfuscating the BuildConfig class to a.a.class, conflicting with other libraries.
    Open source →
  58. 4.12.3 05 Sep 2023
    Release notes
    • [Android] Performance enhancements and error-checking.
    Open source →
  59. 4.12.2 25 Aug 2023
    Release notes
    • [Android] Fix memory-leak in .startBackgroundTask: If a Task timed-out and is "FORCE KILLED", it was never removed from a List<Task>.
    • [Android] Fix Exception NullPointerException:at com.transistorsoft.locationmanager.util.BackgroundTaskWorker.onStopped
    Open source →
  60. 4.12.1 23 Aug 2023
    Release notes
    • [iOS] Fix build failure "Use of '@import' when C++ modules are disabled"
    • [Android] Modify Foreground-service management to use stopSelfResult(startId) instead of stopSelf(). This could improve reports of Android ANR Context.startForeground.
    • [Android] Add sanity-check for invalid Geofence arguments (eg: invalid latitude/longitude).
    • [Android] Add safety-checks in ForegroundService stop-handling. There was a report of a reproducible crash while aggressively calling .getCurrentPosition in a Timer (eg: every second).
    • [Android] Demote HeartbeatService from a Foreground Service to AlarmManager ONESHOT. :warning: In your onHeartbeat event, if you intend to perform any kind of asynchronous function, you should wrap it inside BackgroundGeolocation.startBackgroundTask in order to prevents the OS from suspending your app before your task is complete:
    BacckgroundGeolocation.onHeartbeat((event) async {
      print("[onHeartbeat] $event");
      // First register a background-task.
      var taskId = await BackgroundGeolocation.startBackgroundTask();
      try {
        // Now you're free to perform long-running tasks, such as getCurrentPosition()
        var location = await BackgroundGeolocation.getCurrentPosition(
          samples: 3,
          timeout: 30,
          extras: {
            "event": "heartbeat"
          }
        );
        print("[onHeartbeat] location: $location");
      } catch(error) {
        print("[getCurrentPosition] ERROR: $error");
      }
      // Be sure to singal completion of your background-task:
      BackgroundGeolocation.stopBackgroundTask(taskId);
    });
    
    • [Android] Fix NPE iterating a List in AbstractService.
    • [Android] If a SingleLocationRequest error occurs and at least one sample exits, prefer to resolve the request successfully rather than firing the error (eg: getCurrentPosition, motionchange, providerchange requests).
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive