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 2026Releases
latest 60 of 187-
5.5.024 Jul 2026Release notes
Open source →- [Fixed]
insertLocation()now works — the supplied record is inserted as-given (import-as-is) and the returned Future resolves with the inserted record'suuid. It was previously unimplemented on iOS (the call never resolved) and on Android stored a record with an emptyuuid(sodestroyLocation()couldn't remove it) and an unvalidated timestamp. Timestamps are now normalized (ISO-8601 or epoch), and auuidis 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.
- [Fixed]
-
5.4.012 Jul 2026Release notes
Open source →- [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 backgroundFlutterEnginebut 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
locationuse-case.- Run without foreground-service permissions. You can remove
FOREGROUND_SERVICE/FOREGROUND_SERVICE_LOCATIONfrom 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, eggetLocations(LocationQuery(limit: 500, page: 0, order: LocationQuery.ORDER_DESC)). The.locationsgetter 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.+
- [Fixed][Android] Headless events permanently dropped after the app is relaunched and terminated a second time (
-
5.3.022 Jun 2026Release notes
Open source →- [Added] New event
onLocationFilter— fires when the tracking location-filter rejects a location (eg: horizontal accuracy worse thanLocationFilter.trackingAccuracyThreshold, or a GPS spike under theConservativepolicy: implausible implied-speed / statistical outlier). Rejected locations are not delivered toonLocation, so this is the only way to observe and adapt to them. The event provides the rejectedlocation, a normalizedreason("low-accuracy"|"implied-speed"|"outlier-capped"),accuracy, andtrackingAccuracyThreshold. - [iOS] Pin
TSLocationManager ~> 4.2.0 - [Android] Pin
tslocationmanager 4.2.+
- [Added] New event
-
5.2.112 Jun 2026Release notes
Open source →- [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 ofLocationFilter.policy. Defaults toadjust(existing behavior: anomalous samples are capped but still accumulated); useconservativeto reject GPS teleports outright, eliminating phantom odometer distance on devices that emit corrupted location bursts. - [Fixed] Odometer under-counted the first
motionchangelocation 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.conservativerejected the firstmotionchangefix 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
FlutterFrameworkdependency in the plugin'sPackage.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.filteroptions now apply at runtime viasetConfigwithout restarting tracking (parity with iOS). - [Changed] Example app — migrated the iOS Runner to the UIScene lifecycle (
UIApplicationSceneManifest+FlutterImplicitEngineDelegateplugin registration), ahead of Apple's upcoming requirement. - [Changed] Minimum Flutter SDK raised to
>=3.38.0(aligned withbackground_fetch; required by the Swift Package ManagerFlutterFrameworkintegration).
- [iOS] Pin
-
5.2.014 May 2026Release notes
Open source →- [Fixed][Android]
watchPositioncrashes —Integer→Long/Integer→DoubleClassCastException from Flutter MethodChannel type mapping, and incorrectMapresponse shape where Dart expected anintwatchId. - [Fixed][Android]
watchPosition@UiThreadRuntimeException —EventSink.success()called from background thread pool; now posted to main thread viaHandler(Looper.getMainLooper()). - [Added] New
Subscriptionclass —watchPositionand allon*event-listener methods now return aSubscriptioninstance with a.remove()method for convenient listener teardown. - [Changed] Example app — added "Watch position" toggle to SpeedDial FAB menu.
- [Fixed][Android]
-
5.1.220 Apr 2026Release notes
Open source →- [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 backgroundFlutterEnginewas never destroyed, so on main Activity reattach the stale engine conflicted with the freshly attaching main engine's plugin channels.HeadlessTask.destroyBackgroundIsolate()now runs whenBackgroundGeolocationModule.setActivity(activity)receives a non-null Activity, clearing the background engine before the main engine attaches. - [Changed] Example
main.dart— added boot-traceprint()milestones to make stuck-splash reproductions immediately identify the Dart boot stage that hangs. - [Changed] Example bumps
background_fetchto^1.6.2for the sibling fix that surfaced once the background engine started being properly destroyed (MissingPluginExceptiononcom.transistorsoft/flutter_background_fetch/methods).
- [Fixed][Android] App stuck on splash / logo after relaunch when the foreground service kept the process alive past Activity termination. Root cause:
-
5.1.110 Apr 2026Release notes
Open source →- [Added] New config option
PersistenceConfig.timestampFormat— set to"epoch"to receivetimestampandrecorded_atas epoch milliseconds (number) instead of the default ISO-8601 UTC strings. - [Fixed][Android]
getCurrentPositiontimeout (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.
- [Added] New config option
-
5.1.007 Apr 2026Release notes
Open source →🚀 Zero Third-Party Native Logging Dependencies
The native
TSLocationManagerSDK no longer depends on any third-party logging frameworks on either platform:- [iOS] Removed
CocoaLumberjack— replaced with a custom, zero-dependency SQLite-backed logger usingos_logfor console output. - [Android] Removed
slf4j/logback-android— replaced with a custom SQLite-backed logger using the native AndroidLogAPI.
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/uploadLogfunctionality remain identical.- [iOS] Pin
TSLocationManager ~> 4.1.0 - [Android] Pin
tslocationmanager 4.1.+
- [iOS] Removed
-
5.0.726 Mar 2026 -
5.0.626 Mar 2026Release notes
Open source →- Fix
Package.swiftfor SPM users. The package name is renamedBackgroundGeolocation
- Fix
-
5.0.521 Feb 2026 -
5.0.430 Jan 2026 -
5.0.329 Jan 2026Release notes
Open source →- 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.
-
5.0.228 Jan 2026Release notes
Open source →- [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
setOdometernot resolving itsPromise
-
5.0.115 Jan 2026 -
5.0.014 Jan 2026 -
5.0.0-beta.403 Dec 2025 pre-release -
5.0.0-beta.302 Dec 2025 pre-releaseRelease notes
Open source →- [Android] Add proguard rules to preserve flutter plugin classnames (eg: HeadlessTask) in release with minifyEnabled.
-
5.0.0-beta.224 Nov 2025 pre-releaseRelease notes
Open source →- Bug fixes.
- [Android] Add guards against spurious geofence exit events reported with certain devices.
-
5.0.0-beta.110 Nov 2025 pre-release -
4.18.314 Jan 2026Release notes
Open source →- [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
-
4.18.229 Nov 2025 -
4.18.109 Nov 2025Release notes
Open source →- [Android] pin
tslocationmanagerat3.+in preparation for next release..
- [Android] pin
-
4.18.008 Sep 2025Release notes
Open source →- [Android] Remove Huawei HMS support for failure to provide their SDKs with Android 16KB Page Size compatibility.
-
4.17.125 Aug 2025 -
4.17.030 Jul 2025Release notes
Open source →- [iOS] Implement Swift Package Manager support
- [example] Re-factor /example app's location marker images.
-
4.16.1207 Jul 2025Release notes
Open source →- [Android] Rebuild
tslocationmanagerwith AGP >= 8.5.1 - [example] Update example's
flutter_mapto latest8.1.1 - [Android] Implement behaviour for
locationAuthorizationRequest: "Any"to not continue showingbackgroundPermissionRationaleafter user clicks[CANCEL]button.
- [Android] Rebuild
-
4.16.1116 Jun 2025Release notes
Open source →- [Android] Fix issue with polygon geofencing where
identifierconsists of long strings, such asaaaa-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.
- [Android] Fix issue with polygon geofencing where
-
4.16.1019 May 2025Release notes
Open source →- [Android] Support 16KB pages sizes.
- [iOS] Fix
ProviderChangeEvent.enablednot showing the result of global Privacy -> Location Services -> Enabled switch - [Android] Fix
java.util.ConcurrentModificationException at com.transistorsoft.locationmanager.location.SingleLocationRequest.getBestLocation.
-
4.16.913 Feb 2025 -
4.16.813 Feb 2025 -
4.16.713 Feb 2025 -
4.16.619 Dec 2024 -
4.16.503 Dec 2024Release notes
Open source →- [Android] Remove Android Setup Step for
proguard-rules.proin yourandroid/app/build.gradle. The SDK is now able to automatically apply its requiredproguard-rules.pro.
- [Android] Remove Android Setup Step for
-
4.16.413 Nov 2024Release notes
Open source →- [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'sMainActivityto terminate on some devices.
- [Android] Remove enforcement of minimum Geofence radius
-
4.16.308 Nov 2024Release notes
Open source →- [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
TSConfigdue to "uncaught exception NSInvalidArgumentException" - [Android] Change
foregroundServiceTypeonLocationRequestServicefromshortService->location. - [iOS] Address inconsistent location-tracking performance on iOS.
-
4.16.223 Oct 2024Release notes
Open source →- [iOS] Fix bug with
triggerActivitespreventing motion-triggering in iOS simulator with simulated location.
- [iOS] Fix bug with
-
4.16.123 Oct 2024Release notes
Open source →- [Android] Implement
Service.onTimeoutto handleforegroundServiceType="shortService"timeouts. - [iOS] Add new
Config.activityTypeACTIVITY_TYPE_AIRBORNE. - [iOS] Implement
Config.triggerActivitiesfor iOS. - [Android] Guard against
NullPointerExceptionreceiving a null location inPolygonGeofenceServiceevent. - [Android] Remove unused
imports related to Flutter V1 Embedding. - [Android] Address possible leak of
Activityreference when terminating the app. Ensure internal reference toActivityis nullified when app is terminated. - [Android] Add improvements to Android geofencing-only mode with
goefenceModeHighAccuracy: truewhere motion-activity updates disabled. - [Android] Add error-checking in polygon-geofencing to handle a possible
NullPointerException. - [iOS] Fix broken linking to Settings screen in
locationAuthorizationAlerton iOS 18.
- [Android] Implement
-
4.16.004 Sep 2024Release notes
Open source →- [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
notifyOnDwellfor polygon-geofences.
- [iOS] Fix bug in iOS Polygon Geofencing when running in geofences-only mode (
-
4.15.514 Jun 2024Release notes
Open source →- [Android] Remove permission
FOREGROUND_SERVICE_HEALTH. It turns out that this permission is no longer required when theActivityRecognitionServivceis defined with aforegroundServiceType="shortservice", which allows a background-launched foreground-service to stay active for up to 3 minutes, which is sufficient for theActivityRecognitionService, which typically stays activated only for a few milliseconds.
- [Android] Remove permission
-
4.15.405 Jun 2024Release notes
Open source →- [Android] Fix issues #1298 "Multiple geofence events triggered for a single geofence registration when registered individually".
-
4.15.314 May 2024Release notes
Open source →- [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
FormatExceptioninstead ofPlatformException.
-
4.15.222 Apr 2024Release notes
Open source →- [iOS] Code-sign
TSLocationManager.xcframeworkwith new Apple Organization (9224-2932 Quebec Inc) certificate.
- [iOS] Code-sign
-
4.15.128 Mar 2024Release notes
Open source →- [iOS] Add PrivacyInfo -> TSLocationManager.xcframework
- [iOS] codesign TSLocationManager.xcframework
- [iOS] Update
CocoaLumberjackversion ->3.8.5(version which includes its ownPrivacyInfo) .
-
4.15.019 Mar 2024Release notes
Open source →- [iOS] Implement new iOS Privacy Manifest
- Add property
AuthorizationEvent.status, provding the HTTP status code from therefreshUrl.
-
4.14.318 Mar 2024Release notes
Open source →- [iOS] Fix bug in iOS scheduler, triggering ON incorrectly. For example, given a
schedule: ['1 00:00-23:59'], the plugin was trigging on forDAY 2`.
- [iOS] Fix bug in iOS scheduler, triggering ON incorrectly. For example, given a
-
4.14.214 Mar 2024Release notes
Open source →- [iOS] Fix bug in polygon-geofencing: monitoredIdentifiers not being cleared when
.removeGeofences()is called, can result in null-pointer exception.
- [iOS] Fix bug in polygon-geofencing: monitoredIdentifiers not being cleared when
-
4.14.112 Mar 2024Release notes
Open source →- [Android] Change
foregroundServiceTypeof the SDK'sGeofencingServicedefinition in itsAndroidManifestfromshortService->location.
- [Android] Change
-
4.14.028 Feb 2024Release notes
Open source →- [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.
- [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
-
4.13.713 Feb 2024Release notes
Open source →- Fix minor static analysis issues reported in
dartcode referencingpart-ofdirective.
- Fix minor static analysis issues reported in
-
4.13.608 Feb 2024 -
4.13.516 Nov 2023Release notes
Open source →- [Android] Fix problem with polygon-geofencing license-validation not working in DEBUG builds when configured with product flavors.
-
4.13.407 Nov 2023Release notes
Open source →- [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
ConcurrentModificationExceptioninSingleLocationRequest.getBestLocation
-
4.13.312 Oct 2023Release notes
Open source →- [Android] Fix
IllegalStateExceptioncalling addGeofences when number of geofences exceeds platform maximum (100).
- [Android] Fix
-
4.13.205 Oct 2023Release notes
Open source →- [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.
- [Android] Fix error Unhandled Exception: type 'Null' is not a subtype of type 'List<Object?>' in
-
4.13.102 Oct 2023 -
4.13.028 Sep 2023Release notes
Open source →- 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.xmlfromAndroidManifest.xml— it's causing conflicts with other plugins. - [Android] Add proguard-rule for compilation of the android library to prevent from obfuscating the
BuildConfigclass toa.a.class, conflicting with other libraries.
- Polygon Geofencing: The Background Geolocation SDK now supports Polygon Geofences (Geofences of any shape). For more information, see API docs
-
4.12.305 Sep 2023 -
4.12.225 Aug 2023Release notes
Open source →- [Android] Fix memory-leak in
.startBackgroundTask: If aTasktimed-out and is "FORCE KILLED", it was never removed from aList<Task>. - [Android] Fix
Exception NullPointerException:at com.transistorsoft.locationmanager.util.BackgroundTaskWorker.onStopped
- [Android] Fix memory-leak in
-
4.12.123 Aug 2023Release notes
Open source →- [iOS] Fix build failure "Use of '@import' when C++ modules are disabled"
- [Android] Modify Foreground-service management to use
stopSelfResult(startId)instead ofstopSelf(). This could improve reports of Android ANRContext.startForeground. - [Android] Add sanity-check for invalid
Geofencearguments (eg: invalid latitude/longitude). - [Android] Add safety-checks in ForegroundService stop-handling. There was a report of a reproducible crash while aggressively calling
.getCurrentPositionin aTimer(eg: every second). - [Android] Demote
HeartbeatServicefrom a Foreground Service toAlarmManagerONESHOT. :warning: In youronHeartbeatevent, if you intend to perform any kind of asynchronous function, you should wrap it insideBackgroundGeolocation.startBackgroundTaskin 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
ListinAbstractService. - [Android] If a
SingleLocationRequesterror occurs and at least one sample exits, prefer to resolve the request successfully rather than firing the error (eg:getCurrentPosition,motionchange,providerchangerequests).