flutter_get_background_loc 0.13.4
flutter_get_background_loc: ^0.13.4 copied to clipboard
Accurate background location for Flutter with GNSS quality metrics, fake-GPS detection, adaptive Kalman filtering and offline-safe uploads.
0.13.4 #
Review fixes on top of 0.13.3 (the still probe, the 40 m skip-hop cap, mid-trip
initialCoarse, Doze alarms, Doppler accuracy, and IMU-only wakes). Every change is
configurable; defaults are documented in doc/configuration.md,
doc/filtering.md and doc/motion-and-power.md.
- Still probe never starts the service cold. When tracking should already be running
(
ConfigStore.wasRunning),ACTION_STILL_PROBEis delivered through a non-exportedBroadcastReceiverand the service callsstartForegroundbefore it runs the probe. If the user has stopped tracking, the probe is ignored and the service is not started. - Skip-hop cap looks at pin age and motion evidence.
filter.odometerSkipHopMaxPinAgeMs(default 30 s;0= motion evidence only; negative = 0.13.3, any hop above the 40 m cap is credited). A 50–100 m indoor snap after a long park is not counted; a mid-drive hop or a departure with IMU / activity still is. - A large hop is confirmed before it is odometered.
filter.odometerConfirmLargeHop(defaulttrue) andfilter.odometerLargeHopConfirmFixes(default 2). A hop aboveodometerSkipHopMaxMetersthat passes the pin-age / motion-evidence check is held and added once the next 2 accepted fixes stay farther thanmax(cap, hop / 2)from the point before the hop; if a fix comes back near that point, the hop is dropped. Field check (30 Nov, 18:25 WIB): after a ~16 min GNSS gap the phone came back ~1.5 km from the parked pin, already driving at 6.6 m/s, and Competitor A independently credited ~1.45 km at the same moment. That is real distance driven during the gap: it is still credited (2 s later, same total 11,453.5 m in the replay). Without the guard, a single bad far fix with motion evidence (synthetic test: 1.5 km away after a 51 s gap) was credited and never undone; now it is not. - No mid-trip
initialCoarse.filter.initialFixOnlyAtSessionStart(defaulttrue) allows a provisional coarse pin only at session start. Afterreset(keepOdometer: true)the first post-gap fix is not published asinitialCoarse. - Exact Doze alarm when permitted.
motion.stillProbeUseExactAlarm(defaulttrue) usesAlarmManager.setExactAndAllowWhileIdlewhencanScheduleExactAlarms()is true, and falls back tosetAndAllowWhileIdleotherwise.setAndAllowWhileIdleis throttled under Doze to about one alarm every 9 minutes, which is why the inexact-only 0.13.3 probe could still be late. TheSCHEDULE_EXACT_ALARMpermission is already in the manifest. - More Doppler samples are usable.
motion.gnssSpeedMaxAccuracyMpsdefault is now 1.5 m/s (was 1.0; a field median was 1.2 m/s) andmotion.gnssSpeedMinRatio(default 3.0,0disables) also accepts a sample whenspeed / speedAccuracymeets the ratio. The treadmill replay still shows 0 m of false odometer during the still phase. - The published point stays on the pin while locked.
filter.pinPublishedWhileLocked(defaulttrue) keeps the published latitude/longitude on the lock pin until the release gate passes. A still segment no longer accumulates a path while the odometer stays at 0 (treadmill replay: 0.0 m published path during still). To avoid holding a real departure, three extra release paths fire even without Doppler or activity agreement: distance (pinDistanceReleaseMinFixes3 fixes farther thanmax(25 m, 2 × accuracy)), max hold (pinMaxHoldMs, 20 s continuously far from the pin), and IMU-sustained (pinImuReleaseMinFixes3 displaced fixes with IMU motion). A 276 spinnedReleasestretch on the 29 Nov drive was a stop (GNSS within 6 m, speed 0, quiet IMU); counting only holds where the raw fix is more than 15 m from the pin, the longest hold on real driving is 1.0–2.0 s. - IMU-only wake after a long still.
filter.imuOnlyWakeSecondSourceEnabled(defaulttrue),imuOnlyWakeMinStillMs(3 min),imuOnlyWakeConfirmMs(10 s): after a still of at least 3 minutes, an IMU-only wake does not publish a jump larger than the lock-release near radius until activity recognition or Doppler confirms. A late confirm is still accepted (safer than leaving a real departure pinned). A single usable Doppler sample at or abovegnssMovingSpeedMpscan confirm this wait (filter.imuOnlyWakeConfirmOnUsableDoppler, defaulttrue). - Odometer does not grow while Doppler says still.
filter.odometerHoldWhenDopplerStill(defaulttrue) ignores a reported GNSS speed belowgnssStillSpeedMps(even whenspeedAccuracyis poor). Stalevehicleactivity is not enough on its own (odometerVehicleNeedsSpeedOrImu, defaulttrue); walking / on-foot / running is still counted. A min-net commit is also capped by the Doppler consistency limit so an 80 m parked snap cannot bypass it. On the 30 Nov field replay the long park (13:50–18:25) and the 18:41–18:56 stop go from 111 m / 118 m of odometer to 0 m. - A far, usable Doppler departure can publish on the first fix.
filter.lockReleaseFarDopplerMeters(default 40 m, above typical indoor still-probe wander) with usable Doppler at or abovelockReleaseFastSpeedMpswakes the lock and releases the pin in one sample. This cut the 30 Nov 18:25 departure from 12.4 s to 10.4 s (the first good raw fix). A 20 m / 2.3 m/s still-probe-like fix is intentionally not enough, so the treadmill still-path stays at 0 m. - Replay tool.
dart run tool/replay_published.dart <fixes.csv> <events.csv> <out.csv>runs this version of the filter engine over a raw-fixes CSV (the same columns the package tests use). Optional environment overrides, merged onto the defaults:REPLAY_FILTER_JSONandREPLAY_MOTION_JSON(JSON objects). The tool ships with the package and does not include any private logs.
0.13.3 #
Field-run fixes from a 5 h 22 min outdoor run (13:34–18:56 WIB, both apps on one phone;
4.6 h parked indoors with every raw fix at 100–350 m accuracy). Every change is configurable;
defaults are documented in doc/configuration.md.
- The odometer no longer discards real distance. The release / wake skip-hop used to drop the
whole hop from the pinned point to the first released fix. When the car started rolling while the
lock still held (Doppler accuracy 2–7 m/s, so Doppler was unusable; activity reported still), that
hop was real travel: the run lost 123.7 m + 96.3 m + 31.9 m of 5.8 km. Now a hop is discarded
only when it is a residual snap:
filter.odometerSkipHopMaxMeters(default 40 m). A larger hop is credited, andfilter.lockReleaseSkipHopOnlyFromStill(defaulttrue) keeps a mid-drive IMU bump from arming the skip at all. 0 = always skip (0.13.2 behaviour). - The still/balanced silence probe survives Doze. It was a
Handler.postDelayedonly, which is deferred while the CPU sleeps: with a 120 s interval the run saw probes after 875 / 733 / 546 s and one 50-minute gap with no fix. It is now also armed withAlarmManager.setAndAllowWhileIdle(cancelled as soon as a fix arrives), so a parked phone keeps probing while the device dozes. - Tests. Unit tests for the hop cap (a 120 m hop is credited, an 18 m snap is skipped) and a
replay of the field run (
test/replay/run_20261130_133423_replay_test.dart, Eiffel offsets). Replay odometer 11877 m, no decrease across the 4.6 h still and the gaps (field 0.13.2: 10191 m).
Bench note: analyze_moving.py no longer scores held / pinned points as observations (they repeat
the last known position) and reports the odometer against a moving reference, so a parked
phone's multipath wander no longer makes a correct odometer look 15 % short. On this run the
corrected figures are cross-track p95 4.1 m (was reported as a 1450 m maximum) and odometer
99.7 % of the moving reference.
0.13.2 #
Fixes from the outdoor drive replay (synthetic Eiffel Tower offsets of the 29 Nov run): the odometer
no longer goes back to zero after a GNSS gap, the lock-release gate no longer holds real driving for
tens of seconds, and the accuracy-spike gate no longer rejects a smooth accuracy rise for 24 s. Every
change is configurable; defaults are documented in doc/configuration.md and
doc/filtering.md.
- Odometer across a gap (
filter.odometerPreserveAcrossGap, defaulttrue). Areset()after a gap longer thanresetAfterGapMs, and a mid-runupdateConfig/setPreset, keep the distance already driven. The distance travelled during the gap is not guessed: the first post-gap fix is a skip-hop, so the odometer can lag reality but never over-counts. An explicit reset still zeroes it. Setfalsefor the 0.13.1 behaviour. - Release gate from the previous raw fix (
filter.lockReleaseFromPreviousRaw, defaulttrue;lockReleaseMaxAccuracyMeters25 m,lockReleasePrevRawMaxAgeMs5 s). The trail used to measure its first step from the pinned point, so after a long park the implied speed looked too low and the gate stayed closed until the car was ~90 m away. A stale or coarse reference is not used: the fix becomes a seed and the trail still needslockReleaseMinFixesvalid steps. - Vehicle fast release (
filter.lockReleaseVehicleFastWake, defaulttrue;lockReleaseFastSpeedMps3 m/s,lockReleaseFastMinFixes2,lockReleaseFastSpeedAccFactor2.0,lockReleaseFastMaxGapMs3 s). DopplerspeedAccuracyof 0 is treated as missing (many Android plugins send 0), and a missing one always needs the full streak. A soft veto holds the fast path only while the OS reportsstill, the IMU is quiet and Doppler is weak, so a real departure is not delayed. A coarse fix never opens the gate. - Spike agreement (
filter.spikeAgreeFixes3,spikeAgreeRatio1.5,spikeAgreeMaxAccuracyMeters25 m) and rejection cap (filter.spikeMaxConsecutiveRejects8). A run of rejected fixes is accepted when it agrees in accuracy, moves consistently and stays within the absolute cap; a steadily rising accuracy that never agrees is accepted after the cap.0disables each option (0.13.1 behaviour). - Tests. Unit tests for the odometer gap, the release gate (fast path,
speedAccuracy0, soft veto, coarse guard,isVehicleActivity) and the spike gate, plus a replay of the drive (test/replay/run_20261129_160447_replay_test.dart) run twice: with the fixture's 0.5 m/sspeedAccuracyand with a realistic 1.5 m/s.
Replay numbers (same fixes): 0.13.1-equivalent odometer 11.9 km and a release hold of hundreds of seconds; 0.13.2 odometer 16.2 km, longest hold 1.8 s, longest spike streak 2.
0.13.1 #
False-wake and false-distance fixes from a treadmill run (phone lying still on a running treadmill
for 12 minutes: about 23 m of false odometer during the still phase in 0.13.0, 0 m in the new
replay test). Every change is configurable; defaults are documented in
doc/configuration.md, doc/filtering.md
and doc/motion-and-power.md.
- Doppler re-acquisition guard (
motion.dopplerWakeIgnoreAfterAcquireMs, default 10 s;motion.dopplerAcquireGapMs, default 5 s). While locked, Doppler speed is ignored right after a GNSS (re-)acquisition such as a still-probe start, where 1–5 m/s transients were seen on a still phone. - Doppler wake needs corroboration (
motion.stationaryDopplerWakeRequiresImu, defaulttrue;dopplerWakeImuMinRms1.5 m/s²;dopplerWakeSustainedMs20 s). While locked, Doppler alone wakes only with IMU RMS ≥ 1.5, a moving (or pending moving) activity, or 20 s of sustained Doppler motion, so a smooth low-IMU vehicle still wakes. Walking (IMU / AR) is unchanged. - Release gate on any wake (
filter.wakeReleaseGateOnAnyWake, defaulttrue). The lock-release gate and the odometer skip-hop now apply to the first fix after any still-to-moving wake, even when that fix is rejected early by the stationary anchor (previously the gate could be bypassed and a ~25 m indoor snap odometered). - Odometer rules (all
filter.*):odometerRequireMotionEvidence(true, windowodometerMotionEvidenceWindowMs15 s),odometerMinNetDisplacementMeters(8 m overodometerNetWindowMs30 s; jitter around one spot is not counted, the odometer lags real travel by up to 8 m),odometerSkipReinitHop(true; cluster / speed-jump re-init hops are not counted) andodometerDopplerConsistency(true; a step is capped at(speed + speedAccuracy) × dt + accuracywhen Doppler is usable). wakeSourcediagnostics.LocationFix.wakeSource,FilterResult.toMap()['wakeSource']andMotionUpdate.wakeSourcereport what woke the device out of the lock (imu,doppler,activity,displacement,geofence);MotionTracker.wakeCount/lastWakeSourceexpose it to custom pipelines. ThepinnedReleasedetail names the wake source.- Behaviour change. A parked phone with low IMU and no activity recognition now needs 20 s of
Doppler motion (or the 150 m geofence fallback) to leave still. Set
stationaryDopplerWakeRequiresImu: falseanddopplerWakeIgnoreAfterAcquireMs: 0for the 0.13.0 wake behaviour, and the odometer options above tofalse/0for the 0.13.0 odometer. - Tests: synthetic Eiffel Tower replay of the treadmill run (
run_20261129_141602), unit tests for the Doppler guards, the wake-armed gate, the odometer rules and the option round-trip.
0.13.0 #
Startup still / publish hold, a post-unlock release gate, a provisional initial location at Start,
activity-watchdog backoff and still-probe backoff. Defaults are documented in
doc/configuration.md,
doc/motion-and-power.md and doc/filtering.md.
The Android still probe stays on by default (stillProbeIntervalMs: 0 turns it off).
- Start-in-still (
motion.startupStillEnabled, defaulttrue). If the OS activity isstillat or abovestartupStillMinConfidence(80) and IMU RMS has been at or belowimuStillRmsforstartupStillMinImuWindows(2) windows, the motion state entersstilland the pin applies immediately — it no longer waits forstopTimeoutMs(3 min) at the beginning of a session. Mid-drive starts are unchanged: a moving activity or IMU already above the motion threshold aborts this path.stopTimeoutMsstill governs moving to still during a trip. - Startup publish hold (
motion.startupHoldEnabled, defaulttrue,startupHoldTimeoutMs15 s). Once IMU or activity has reported still, wandering GNSS is not published until still is confirmed, motion is corroborated, or the timeout elapses. At most the first good fix is published, then held. GNSS-only sessions (no IMU / activity still evidence) are unchanged. - Lock-release gate (
filter.lockReleaseGateEnabled, defaulttrue). After a corroborated wake leaves still, the pin stays the published point until a new fix is withinmax(lockReleaseMinDistanceMeters, accuracy x lockReleaseAccuracyFactor)(15 m / 1.0) of the pin, orlockReleaseMinFixes(3) consecutive consistent walking-or-faster fixes (or Doppler at walking pace) agree. A geofence-confirmed departure is already corroborated and is not re-held.filter.odometerSkipLockReleaseHop(defaulttrue) does not add the hop from the pin to the first released fix to the odometer. New filter decisions:pinnedRelease,startupHold. - Activity watchdog default
activityWatchdogMsis now 180 s (was 600 s), withactivityWatchdogBackoffEnabled(defaulttrue, capactivityWatchdogMaxMs15 min). If the last activity wasstillat high confidence, the first quiet stretch re-registers but does not arm the 150 m geofence fallback untilactivityDeadAfterSilentCycles(2) silent cycles. - Still-probe backoff (
motion.stillProbeBackoffEnabled, defaulttrue). While locked and activity recognition is confidently still (and the IMU is still), the probe interval grows fromstillProbeIntervalMs(120 s) up tostillProbeMaxIntervalMs(15 min). It resets on a corroborated wake, a moving activity, IMU motion, or a dead AR source. Probe status events includeintervalMsandnextIntervalMs. - Initial coarse fix (
filter.initialFixEnabled, defaulttrue). At Start, a first location may be published as soon as a fix at or belowinitialFixMaxAccuracyMeters(100 m) arrives, withininitialFixTimeoutMs(30 s) of the first processed sample — even when it is too coarse for the normal quality gate (for example indoor hAcc 40–70 m, previouslyrejectedAccuracyNoHdopuntil a later probe). The fix is flaggedFilterDecision.initialCoarse(quality = coarse) and is not added to the odometer. When a later fix is at or belowinitialFixRefineAccuracyMeters(30 m, the indoor coarse cap) the pin is moved to that better point asinitialRefine; that hop is not odometered and does not trigger moving. Real AR / IMU / Doppler wakes still leave the lock through the release gate, and mid-drive starts are unchanged. - Tests: synthetic Eiffel Tower replay of indoor runs
20261129_110116and20261129_124637, plus startup still / hold, lock-release, AR-silence, probe-backoff, initial-coarse / refine, and coarse-then-walk / coarse-then-drive cases. Existing drive-after-parking, mid-drive start, walking release, and the20261129_083900replay stay green.
0.12.0 #
Stationary lock, implied-speed gate and a practical activity-recognition fix. Defaults are
documented in doc/configuration.md,
doc/motion-and-power.md and doc/filtering.md.
The Android still probe stays on by default (stillProbeIntervalMs: 0 turns it off) but can
no longer declare the device moving by itself.
- Stationary lock (
motion.stationaryLockEnabled, defaulttrue). While the motion state isstill, the last published point is pinned and no new positions are emitted. GNSS displacement cannot leave still. The device leaves still only on:- a moving OS activity sustained for
motion.motionTriggerDelayMs(default 3 s; a return tostillbefore the delay cancels the wake); - sustained IMU RMS above the motion threshold (
motion.stationaryWakeOnImu); - GNSS Doppler speed at walking pace for
gnssSpeedMinFixesconsecutive fixes, typically after a still-probe wake (motion.stationaryWakeOnDoppler); - a large-radius / geofence-style fallback (
motion.stationaryRadiusMeters, default 150 m,stationaryRadiusMinFixes: 2) only when activity recognition is unavailable or silent. Implied speed from the pin must stay at walking pace or above and at or belowfilter.maxImpliedSpeedMps, so an indoor teleport cannot take this path.
- a moving OS activity sustained for
- Activity recognition (Android). The previous Transition API never fired if the phone was
already still when tracking started, so
activitystayednulland the watchdog kept re-registering. The plugin now also registers periodic Activity Recognition updates (motion.activityRecognitionIntervalMs, default 10 s) with explicitPendingIntents (FLAG_MUTABLEon Android 12+) and non-exported receivers, logs registration / permission / failures, and forwards aconfidence(0–100) plus anactivityStatushealth event to Dart. - Implied-speed gate (
filter.maxImpliedSpeedMps, default 60 m/s,impliedSpeedFromPublishedEnabled: true) against the last published or held point, including after an EKF re-init, with no accuracy margin. The raw-to-rawmaxSpeedKmhgate is unchanged. - Odometer accuracy threshold (
filter.odometerAccuracyThresholdMeters, default 20 m): published distance is only accumulated when the current fix is at least this accurate.LocationFix.odometercarries the running total. - Anchor trail exit is a strict fallback: the minimum outward step is accuracy-scaled
(
indoor.anchorTrailScaleMinStep, defaulttrue, factor 0.5), the path must be mostly straight and at least walking pace, andonDisplacementno longer leaves still.indoor.leavingAnchorMinFixes(default 3) must elapse beforeleavingAnchoris true. A still probe returns to low power unless a corroborated wake has already left still. - New diagnostic fields on
LocationFix/FilterResult/MotionUpdate:imuRms(already present),activityConfidence,filterDecision,distanceToAnchor,leavingAnchor,odometer. New filter decision:pinned. - Tests: synthetic Eiffel Tower replay of an indoor still run (must stay pinned, false distance under 25 m, 70 / 186 m/s snaps rejected), creep and probe-burst cases, and drive-after-parking adapted so a real drive-away is still detected via AR / IMU / Doppler or the geofence fallback.
0.11.2 #
- Docs: the README is now short (install, quick start, presets, links); the details moved to pages
under
doc/. Installation now usesflutter pub add flutter_get_background_loc.
0.11.1 #
- No Material import in the package.
package:flutter/material.dartis deprecated since Flutter 3.50 (pub.dev static analysis reported it as 3 issues). The built-in dialogs ofLocationPermissionFlow,BackgroundLocationDisclosureandOemBackgroundHelper(OemGuideDialog) are now built withpackage:flutter/widgets.dartonly, so they work the same in apps that use the legacy Material library,material_uiorcupertino_ui, and the package gains no new dependency. The look follows the calling context (text style fromDefaultTextStyle, accent fromDefaultSelectionStyle, whichMaterialAppsets to the primary color). The existingbuilder/promptBuilderhooks still let an app show its own dialogs. - Tests and the example app use
package:material_ui(dev dependency / example dependency only). - New test: the disclosure dialog works under a plain
WidgetsAppwithout any Material ancestor. - GitHub Actions: CI (format, analyze, test, publish dry run) and tag-based publishing to pub.dev; README "Releasing" section and screenshots.
- Docs: README badges (pub version, pub points, likes, platforms, CI, license, flutter_lints) and a demo
video at the top (animated preview linking to
doc/videos/demo.mp4on GitHub).
0.11.0 #
Optional GNSS warm-up ("offline readiness"). Fully opt-in: nothing changes unless you call it.
FlutterGetBackgroundLoc.warmUpGnss({timeout, targetAccuracyM, requireNetwork, refreshAssistance})runs a short GPS session and returns aGnssWarmUpResult(success,reasonasGnssWarmUpFailure,timeToFirstFix,accuracyMeters,satellitesVisible/satellitesUsed,networkAvailable,assistance,fixesReceived,trackingWasRunning, ...). It never throws, needs no tracking service and does not interfere with a running one. A missing permission is a clearpermissionDenied/preciseLocationRequiredresult; no dialog is shown.- Android:
GPS_PROVIDERsession +GnssStatuscallback (satellites, OS time-to-first-fix). Optional best-effort assistance refresh viasendExtraCommand(force_time_injection,force_psds_injection, legacyforce_xtra_injection), guarded by try/catch and by the normal permissionACCESS_LOCATION_EXTRA_COMMANDS, which the host app declares (the plugin manifest does not).delete_aiding_datais never sent. No third-party packages. - iOS: equivalent best effort with its own
CLLocationManager(kCLLocationAccuracyBest) until the accuracy target or the timeout. iOS manages assistance data itself. HealthStatus.lastGnssFixAt,gnssDataAge,isGnssDataStale([threshold = 4 h]): time of the last real GNSS fix (persisted; also updated by the warm-up) so apps can warn that data may be stale. Not part ofwarnings.LocationConfig.warmUp(GnssWarmUpConfig):autoWarmUpBeforeStart(default false),timeout,targetAccuracyM,requireNetwork,refreshAssistance. With the flag on,startServicewarms up first and publishes agnssWarmUpstatus event, then starts tracking regardless of the outcome.- Optional indoor score and state (
IndoorConfig.robust,RobustIndoorConfig, default off): a 0..1indoorScoreand a tri-stateIndoorState(indoor/outdoor/unknown) from the average accuracy (10 m -> 0, 40 m -> 1, weight 0.15), the mean C/N0 of all used satellites (32 -> 0, 22 dB-Hz -> 1, weight 0.65), the new Androidcn0Top4(mean of the four strongest used satellites, 35 -> 0, 20 -> 1, weight 0.10) and used satellites (8 -> 0, 0 -> 1, weight 0.10); anetworkfix floors the score at 0.7; iOS uses accuracy only with its own thresholds. Time-window hysteresis (enter indoor >= 0.7 for 12 s, exit < 0.4 for 4 s). The filter uses it as a weight only: indoor + still strengthens the anchor, indoor + moving inflates measurement noise and the jump-test margin; no fix is dropped because of it. New:LocationFix.cn0Top4/indoorState,HealthStatus.indoorScore/indoorState,Heartbeat.indoorState,IndoorScorer.reset(). The legacyindoorLikelyis unchanged while the detector is off. - Fix: a drive that starts after the phone was parked could be swallowed by the stationary
anchor. With a smooth IMU (phone in a car holder) and no usable Doppler
speedAccuracy, none of the anchor exits fired, so every fix was rejected as "anchored ... no motion exit", the motion state stayedstilland the low-power (balanced, 30 s / 20 m) priority stayed on: the track became a straight line from the parking spot to wherever the anchor finally let go. New outward-trail exit (IndoorConfig.anchorTrailExitEnabled, default on): consecutive accurate fixes outside the exit radius that each move farther from the anchor (anchorTrailMinFixes3,anchorTrailMinStepMeters2 m, or two fixes with an outward step >=anchorTrailFarStepMeters50 m, accuracy <=anchorTrailMaxAccuracyMeters20 m) release the anchor and count as motion evidence (MotionTracker.onDisplacement), which also restores high-accuracy tracking. A static or jittering multipath cluster or a slow drift never qualifies. Moving-trail re-init: when the EKF rejects a steady, plausible, mostly straight run of fixes (for example after a 90-degree turn without Doppler), it restarts on the newest fix with the trail's speed and heading instead of holding until a static cluster forms. Counters:trailExitCount,trailReinitCount. Probe: while the anchored low-power priority is on, a fix outside the anchor's exit radius switches to high accuracy right away (LocationFilterEngine.leavingAnchor), so a departure is confirmed within seconds instead of one fix every 30 s; a multipath blip that returns inside goes back to low power. - Android silence probe in low power (
MotionConfig.stillProbeIntervalMs= 120 s,stillProbeDurationMs= 20 s;0turns it off): when the balanced request has delivered no fix for the interval, the service registers a high-accuracy request for the duration (status eventstillProbe), then returns to balanced unless the filter saw a departure. Fixes a field case where the fused provider delivered nothing at balanced priority for 17 minutes of driving, so low power never ended (no fixes meant no motion evidence) until the 15-minute provider watchdog. - Example app rewritten for the current API: presets, start / stop,
positionStream,motionStream,heartbeatStream,statusStream, periodichealthCheck(), GNSS warm-up and switches forIndoorConfig.robust,anchorTrailExitEnabledand the still probe (applied withupdateConfig). Newexample/README.md;minSdk24 like the plugin; cleartext HTTP removed from the example manifest. - Repository tidy-up for GitHub: generated files removed,
.gitignore/.pubignorecover Flutter tool output with local paths, README has git-dependency install, the new options in the feature table and a License section; the offline replay tool is nowtest/replay/replay_field_log_test.dart. - README: new section "GNSS warm-up (offline readiness)" with examples and honest caveats (best effort, OS dependent, no guarantee that assistance data is downloaded).
- Package layout for pub.dev:
.pubignore/.gitignoreexclude logs, releases, APKs, keystores and build outputs;example/is now a minimal app;analysis_options.yamlusesflutter_lints; dartdoc added. - Privacy cleanup of docs and tests: sample coordinates are now a public landmark, no device model or building details.
0.10.1 #
LocationPermissionFlowalso requests activity recognition (Android 10+ACTIVITY_RECOGNITION/ iOS Motion & Fitness) after the notification step. An in-app prompt is shown when the permission is not already granted (PermissionFlowTexts.activityRecognition,PermissionStep.activityRecognition,run(activityRecognition:)). Declining that prompt skips the request but does not cancel the flow: tracking can start without it.- README Quick start now runs
LocationPermissionFlow.run(context)beforestartService.
0.10.0 #
Tracking presets: one switch for the battery / accuracy trade-off, changeable while the service runs.
TrackingPreset(powerSaver,balanced,highAccuracy,custom). Build a config withLocationConfig.forPreset(preset, base:, intervalMs: ...)/config.withPreset(...): the preset replaces the tuning fields (interval, distance filter, priority, GNSS measurements / full tracking, accuracy gates, the still / anchored low-power switches, batching) and keeps everything else (notification, send, ...). Named arguments override single preset values;customapplies no preset values, only the overrides.powerSaver: balanced-power priority all the time, 30 s / 25 m, no GNSS measurement listener, no full tracking, accuracy gate 50 m (coarse limit 100 m). Roughly 20-50 m fixes.balanced(default): exactly the 0.9.0 behaviour.highAccuracy: high priority every second, full tracking, GNSS measurements and IMU on, no batching, never drops to balanced priority while still or anchored.
FlutterGetBackgroundLoc.setPreset(preset, {overrides})switches a running service without restarting it (Android: new nativeapplyPreset: the fused request, the GNSS measurement listener and the sensors are re-applied in place; iOS falls back toupdateConfig). The background filter re-evaluates the low-power switch right away. BeforestartServiceit only prepares the config (returns false).- New
LocationConfigfields:preset,priority(LocationPriority.high/balanced, the priority while moving) andenableGnssMeasurements(false = the measurement listener is never registered; it keeps the receiver tracking at 1 Hz). AlsoLocationConfig.copyWith(...). - The active preset is reported in
healthCheck()(HealthStatus.preset,priority,gnssMeasurementsEnabled), in thepresetChangedstatus event, in every heartbeat and in every fix (LocationFix.preset, payload groupquality, opt out withpayload.quality = false). - No "no fix" health warning for the sparse balanced base priority of the power saver.
- README: "Tracking presets" with a battery vs accuracy table (indicative values, measured on a Xiaomi device).
0.9.0 #
Hand-held phones no longer look "moving" forever, large-accuracy fixes cannot move the position, an anchor formed on a drifting position can heal, and the receiver goes to low power as soon as the phone is anchored. Every new option is opt-out; the notes below name the switch.
- Sustained motion + hand-jitter agreement (
MotionConfig). IMU RMS aboveimuMotionRmscounts as motion evidence only afterimuMotionMinFixes(2) consecutive fixes, or at once fromimuStrongMotionRms(2.0 m/s^2) up; 1 restores the old single-fix reset. While the OS activity saysstillAND the GNSS Doppler speed says still, a hand-held phone (RMS 0.4-1.5) is not motion: the still window may start at RMS <=imuJitterStillRms(1.0) and motion needs RMS >imuJitterMotionRms(1.5) forimuJitterMinFixes(5) consecutive fixes (handJitterEnabled, false = strict thresholds). The agreement ends the moment the activity changes or the Doppler speed rises. Field log (hand-held, indoors, 80 min):MotionState.still0.1 % -> 34 % of the fixes, IMU still window 19 % -> 78 %. NewMotionTracker.handJitterAgreement. - Large hAcc never moves the position.
IndoorConfig.coarseMaxAccuracyMetersdefault 50 -> 30: a fix with hAcc above 30 m is rejected (reported with its reason, visible in the logs) and the last filtered fix is re-emitted asheld. Set 50 to get the old reach back. - Re-anchor on a persistent cluster (
IndoorConfig.anchorReanchorEnabled,anchorReanchorAfterMs120000,anchorReanchorMinFixes20,anchorReanchorMaxAccuracyMeters8,anchorReanchorMaxMeters40). The 0.8.0 anchor hold could freeze on a drifting position and then ignore the correct fixes for the rest of the stop (field log: 19 minutes, 20 m off). Fixes the anchor contradicts (beyond the hold radius or refused by the EKF) are collected; when they have persisted for 120 s and >= 70 % of them agree with their own median, the anchor moves there without motion evidence, but only withinanchorReanchorMaxMetersof the old anchor: a bigger jump (the 0.8.0 persistent-jump protection) still needs motion. A fix the EKF accepts while anchored clears the collection. Counted inreanchorCount. - Anchored output does not expire. A rejected fix re-emitted the last filtered fix only up to
holdMaxAgeMs(10 min); a long anchored stop therefore produced no position at all after 10 minutes (seen in the replay of 0.8.0). While anchored the held position is kept for as long as the anchor holds. - Low power while anchored (
MotionConfig.balancedWhenAnchored, default true, needsbalancedWhileStill). Balanced priority +stillIntervalMs/stillMinDistanceMetersstart when the anchor is held without recent motion evidence (a few seconds after the fast anchor) instead of only after the 180 s stop timeout, and high accuracy returns when the anchor is released or motion/activity change is seen. - GNSS measurements are paused while low power (
MotionConfig.fullTrackingWhileStill, default false). A registered GnssMeasurements listener keeps the receiver tracking at 1 Hz even when the location provider is OFF (seen withdumpsys location: measurements delivered every second after the balanced switch), and full tracking also disables duty cycling. The listener is unregistered in low power and registered again (with full tracking whenenableFullTracking) on motion.fullTrackingWhileStill: truekeeps it. - Replay tooling:
test/replay/replay_field_log_test.darttakesFGBL_REPLAY_FROM/FGBL_REPLAY_TO/FGBL_REPLAY_IGNORE_BOOTand treats a same-second activity pair as exit + enter.
0.8.0 #
Stationary anchor: no more snapping to a persistent GNSS jump, a faster anchor, and GNSS Doppler speed as a third still/motion input. Every new option is opt-out and the defaults are safe; setting them off restores the 0.7.x behaviour.
- Anchor hold (fix). In 0.7.x a frozen anchor rejected a far fix by the EKF Mahalanobis gate only. While
rejecting, the predicted covariance kept growing (about with time cubed), so after ~1-2 minutes the same
wrong cluster passed the gate and the output snapped to it without any motion (seen in a field log: a 77 m
snap at
still: true). Now (a) a fix farther than the exit radiusmax(anchorExitMinMeters, anchorExitAccuracyFactor x accuracy)never reaches the EKF while anchored, however long it persists (IndoorConfig.anchorHoldEnabled, default true; counted inLocationFilterEngine.anchorHeldCount), and (b) the position 1-sigma is capped while anchored (anchorMaxPositionStdMeters, default 2.0 m, 0 = off;AdaptiveKinematicEkf.stationaryMaxPositionStd). The anchor is left only by motion ANDanchorExitConsecutiveconsecutive outside fixes, or by the Doppler speed exit below. - Fast anchor. When the IMU window, the OS activity (
still) and GNSS Doppler speed (< 0.5 m/s with a usablespeedAccuracy) all agree, the anchor engages afterfastAnchorAfterStillMs(10 s) instead of 45 s (fastAnchorEnabled,fastAnchorMinFixes5,fastAnchorRequireActivitytrue). The 45 s path stays as the fallback. A vehicle idling at a red light (activityvehicle) never qualifies.fastAnchorRequireActivity: falselets IMU + GNSS speed decide (no activity-recognition permission). Counted infastAnchorCount. - GNSS Doppler speed as a third input (
MotionConfig.gnssSpeedEnabled,gnssStillSpeedMps0.5,gnssMovingSpeedMps1.0,gnssSpeedMaxAccuracyMps1.0,gnssSpeedMinFixes3). Hysteresis (still < 0.5, moving >= 1.0, dead band keeps the state), a state flips after 3 consecutive fixes, and a fix without a usablespeedAccuracyis ignored. "Moving" is motion evidence like IMU motion: it ends the still window and blocks a new one, so a smooth vehicle (train, car on a motorway) with a quiet IMU no longer reachesMotionState.stillor an anchor. "Still" never forces the still state on its own (it is one vote of the fast anchor). NewMotionTracker.onSpeed,gnssStill,gnssMoving,gnssMovingForMs,activityStill,isStillAgreed. - Speed exit. While anchored, sustained Doppler "moving" releases the anchor at once, even while the
fixes are still inside the exit radius, so walking, cycling and driving are not sticky
(
IndoorConfig.anchorSpeedExitEnabled, default true). - Vehicle model, drive mode and red-light behaviour are unchanged.
- Offline replay tool:
test/replay/replay_field_log_test.dartruns a field log (JSON lines) through the filter (setFGBL_REPLAY_LOG, optionalFGBL_REPLAY_OUT). - Tests:
test/anchor_hold_test.dart(21 cases: persistent 50/80 m jump for 150 s stays put, the 0.7.x leak reproduced with the options off, walking exits within 5 fixes by speed and within ~25 s without a speed, fast-anchor agreement and fallbacks, red light, smooth vehicle, hysteresis, config round-trip).
0.7.1 #
- Android notification crash: an unescaped
}in the live-text placeholder regex threwPatternSyntaxExceptionduringNotificationSupportinitialization.createChannel()failed with it, the fallback notification was posted on a missing channel, and Android killed the app withCannotPostForegroundServiceNotificationException(then "crashed too many times"). The regex now escapes both braces (initialized lazily). The fallback path creates the default channel itself and never touchesNotificationSupport, and it logs the exception class and stack. - Comment typo: an Indonesian example in
BackgroundDisclosureTexts.footerdocs is now English. - Bundled notification icon:
fgbl_ic_locationis now hard-referenced and listed inres/raw/keep.xmlso release builds withshrinkResourcesno longer strip it (it was reported missing and the launcher icon was used).
0.7.0 #
Everything user-facing is customisable. All new options are optional and the defaults reproduce 0.6.x.
NotificationConfig(Android):locationDisabledText,channelDescription,importance(NotificationImportance),visibility,color/colorized,largeIconName,subText,bigText,showTimestamp,showBadge,ongoing,liveTextTemplate/liveTitleTemplate(placeholders such as{speedKmh},{accuracy},{lat},{time}),mockLabel,liveUpdateIntervalMs,tapAction(openApp/deepLink/none) +tapDeepLink, and up to 3 customactions(NotificationAction:stop,openApp,deepLink,event-> statusnotificationAction). The class moved tomodels/notification_config.dart(same public export) and gainedcopyWith.- Runtime updates:
updateNotification(NotificationConfig)re-posts the notification without restarting tracking and persists it for automatic restarts;setNotificationText/clearNotificationTextshow your own title/text. iOS: no-op. - Icons: names resolve in
drawablethenmipmap; a missing resource falls back to the launcher icon, emitserror: notificationIconMissingonce and shows inhealthCheck()(notificationIconResolved,notificationLargeIconResolved) andHealthStatus.warnings. New bundled monochromefgbl_ic_location. The resume notification now uses the configured icon. - Permissions:
LocationPermissionFlow.run(rationale, permanently-denied/settings, location switch off, Play disclosure, "Allow all the time" hint, notification step) withPermissionFlowTexts/PermissionPrompt,skip,promptBuilder; granularpermissionState()(LocationPermissionState); iOScheckIosUsageDescriptions()+IosUsageDescriptions(suggestedInfo.plistwording). - Texts:
HealthStatus.warningsWith(HealthWarningTexts),RestartConfig.resumeChannelName. - README: new "Customization" section.
0.6.0 #
Drive mode, road-hugging and pluggable road snapping. Everything is opt-in/opt-out; a disabled feature costs nothing.
DriveModeDetector(drive.enabled, default on, pure logic): enters on OS activityvehicleor 20 s above 15 km/h (both need > 10 km/h), exits after 60 s below 7 km/h (a traffic light never exits), walking activity 30 s, still activity 60 s, or motion statestill. Ignored while mock-flagged.driveModeis onLocationFix, the payload (groupmotion),MotionUpdate(+driveReason),HeartbeatandhealthCheck().- Vehicle EKF model (
drive.vehicleModel, drive mode only): anisotropic process noise rotated by the heading (lateral 0.2x), soft zero-lateral-velocity pseudo-measurement against a lagged heading, more course trust above 5 m/s with course accuracy < 15 degrees. Skips itself when the course is useless (>= 25 degrees) and during turns (covariance re-opened). Walking/still behaviour is bit-for-bit unchanged. Measured: lateral error 2.6 -> 1.3 m without course, ~-30 % with a 15 degree course, neutral with a good course. - iOS: new method-channel call
setActivityType;IosConfig.driveActivityType(defaultautomotiveNavigation,null= never switch) is applied on drive-mode enter,ios.activityTyperestored on exit. README documents the unmapped-road risk. FilterConfig.driveElasticity(default true): in drive mode uploads are thinned to a speed-proportional distance (drive.elasticSecondsx speed, 5..60 m, at least every 10 s).RoadSnapperinterface (+SnapInput,SnapPoint): runs only in drive mode on a 5-10 fix sliding window, max one call per 5 s, 8 s timeout, failures deliver the fixes unsnapped. AddssnappedLatitude,snappedLongitude,snapConfidence(payload groupsnap) andsnappedFixStream; raw coordinates are kept.LocationConfig.backgroundEntrypoint+runFlutterGetBackgroundLoc({roadSnapper}): your own background entry point (AndroidDartEntrypoint, iOSFlutterEngine.run(withEntrypoint:libraryURI:)), the only way to plug objects into the background isolate.example/:OsrmRoadSnapper(dart:io,/match/v1/driving, configurable base URL; the default is the public demo server - demo only, rate limited) and a switch in the example UI.- Tests:
drive_mode_test.dart(hysteresis incl. traffic light, vehicle model on a straight road and in a turn, config round trips, elasticity,RoadSnappercontract with a fake, disabled features start nothing, iOS activity-type switching).
0.5.4 #
Field-test round on a real Android phone (high floor, next to a window, developer options ON, no mock app).
Fixes
- False mock-GPS detection. One heuristic layer (
imuStationaryButMoved, weight 0.6) was enough to passsuspectThreshold, so GNSS multipath wander on a still phone flagged ~30 % of fixes as mock. NowmockSuspectedneeds an OS mock flag, or heuristic score >= threshold andMockConfig.minIndependentSignals(default 2) independent layers (IMU-vs-GNSS, teleport, native). Developer options never count. IMU drift is also treated as drift when the sky view is poor (indoorScore >= 0.3). NewLocationFix.mockByOsFlag/mockByHeuristicstell hard and soft evidence apart. - Indoor was never detected near a window. Measured: mean C/N0 22-25 dB-Hz, 14-24 of ~75 satellites used,
phone still -> score 0.496, just under the 0.5 threshold. Retuned: low C/N0 threshold 25 -> 28 dB-Hz
(
IndoorConfig.indoorMinCn0), weights lowCn0 0.35 / manyVisibleFewUsed 0.25 / imuStill 0.15, "many visible, few used" ratio 0.3 -> 0.4 (indoorUsedRatio), newveryLowCn0cue belowindoorVeryLowCn0(20). The same data now scores 0.59; open sky (C/N0 38, 50 % used) stays outdoor. Calibration tests use the measured values.
Opt-in / opt-out for everything
- New
LocationConfig.enableGnssStatus,readWifiState,readBattery: whenfalsethe native side does not register the GNSS listeners / never reads Wi-Fi or battery (Android) and iOS leaves battery monitoring off.mock.enabled=falsenow also skips the native mock check. - New
SendConfig.payload: PayloadConfig(speed, bearing, altitude, gnss, imu, mock, indoor, motion, barometer, device, quality)chooses which groups of fields are uploaded. indoor.enabled=falsenow emits no score/reasons at all.- README: new "Features & configuration" table listing every feature with its flag, default and platform.
- Tests:
opt_out_test.dart(disabled features start nothing / emit nothing).
English only
- All user-visible defaults are English: notification and resume texts, background-location disclosure, OEM autostart guide, health warnings, send errors, the example app. README rewritten in English; comments and tests translated.
0.5.3 #
- Keep-alive restart alarm (
RestartConfig.keepAliveMs, default 15 min, 0 = off). On a real Xiaomi/HyperOS phone a hard process kill (SIGKILL/am crash/ OEM killer) was not recovered bySTART_STICKY: tracking stayed dead until the user opened the app. While tracking, the service now keeps asetExactAndAllowWhileIdlealarm armedkeepAliveMsahead and slides it forward from its watchdog, so it only fires after the process died;RestartReceiverthen restarts the service (same eligibility rules/restartBlockedhandling as other restarts). Cancelled onstop()/notification Stop. Verified on device:kill -9-> service back in ~94 s with a 2 min window.
0.5.2 #
Found on a real device (Xiaomi, HyperOS).
- Uploader sent every POST with
Transfer-Encoding: chunked(dart:io default). Many servers/proxies read a chunked body as empty (Content-Length: 0, HTTP 400) so records were bisected away and dropped. BothKeepAliveHttpPosterandoneShotHttpPosternow encode the body and setcontentLength(no chunking).oneShotHttpPoster/defaultHttpPosterare exported. Tests assert length + non-chunked.
0.5.1 #
Fixes from mining the issue trackers of other location packages.
P0
- Removed
DartPluginRegistrant.ensureInitialized()from the background entry point (root isolate of a headless engine; flutter_background_service #375/#428 saw release crashes). Plugins still register through the engine (AndroidFlutterEngine(context), iOSBackgroundEngine). PersistentQueue: every line isjsonDecoded on load (must be a JSON object); corrupt / torn lines are discarded and counted (corruptLines, statusqueueCorrupt); atomic rewrite (temp + rename), flushed appends, missing trailing newline repaired, invalid UTF-8 tolerated.- 4xx bisect: a rejected batch is split recursively so only the bad record(s) are dropped; transient errors while
bisecting keep the rest queued.
SendResult.droppedCount,LocationUploader.droppedCount.
P1
uuid(random v4, no packages) + persisted monotonicseqon every payload (SendConfig.recordIds, default on; retries keep the same ids). README documents server-side dedup/ordering. NewUuid,SequenceCounter.- Android start pre-check:
LocationService.start()runs permission / background-start eligibility checks (same rules asRestartScheduler) and returns the reason instead of starting (startService->false, error + statusstartBlocked,healthCheck().startBlocked);ForegroundServiceStartNotAllowedException/SecurityException->startForegroundFailed.startForeground()is the first thing inonStartCommand(minimal fallback notification),ConfigStore.loadis memoised and prewarmed off the main thread, later failures are reported (startFailed). BackgroundLocationDisclosure: Indonesian prominent disclosure (customisable texts / builder) shown before the system prompts; README section on the Google Play declaration, demo video, privacy policy, data safety.
P2
ExactAlarmPermissionReceiver(ACTION_SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED): re-arms the restart and clearsrestartBlockedwhen granted; statusexactAlarmGranted/exactAlarmRevoked.- Wi-Fi flags:
healthCheck().wifiEnabled/wifiScanAvailable(+ warning),LocationFix.wifiOn, indoor reasonwifiOff(0.10, only with poor accuracy).ACCESS_WIFI_STATEadded. README: the Wi-Fi radio must be on, not connected. - README: removing
ACTIVITY_RECOGNITIONwithtools:node="remove". - iOS
didFailWithError:kCLErrorDomain1 ->permissionDeniedstatus + error, 0 ->locationUnknownstatus, others ->locationErrorwith domain/code.
Example: disclosure flow, startService result, start-blocked / Wi-Fi rows.
0.5.0 #
Power, restart and upload robustness (studied: geolocator, location, background_locator_2, flutter_foreground_task, flutter_background_service, transistorsoft). Already in 0.4.0 and extended here: balanced priority while still.
P0
- WakeLock.
useWakeLockdefaultfalse; a shortacquire(dispatchWakeLockMs = 10 s)wraps every batch dispatch to the isolate; the opt-in long lock always has a timeout (wakeLockTimeoutMs) that the watchdog re-acquires. - Restart on Android 12+/14.
SCHEDULE_EXACT_ALARMdeclared (USE_EXACT_ALARMdeliberately not - Play policy),canScheduleExactAlarms()/openExactAlarmSettings(),setAlarmClockwhen allowed (RestartConfig.useAlarmClock), pre-check ofACCESS_BACKGROUND_LOCATIONand (exact alarms OR battery exemption); otherwise statusrestartBlocked+ "Tap to resume tracking" notification whose tap restarts the service.SecurityException/ForegroundServiceStartNotAllowedExceptionare caught.healthCheck()gainsrestartBlocked,canScheduleExactAlarms,balancedPriority. - Location batching.
setMaxUpdateDelayMillis(10-60x interval, capped) while still or when the send interval >= 30 s; native sorts batches by timestamp; Dart drops fixes older than the last EKF update (FilterDecision.rejectedStale);flushLocations()on stop, priority/motion change and UI open (+ public API). - Upload batching.
SendConfig.syncThreshold,maxSyncLatencyMs,wifiOnly,disableOnCellular(ConnectivityManager / NWPathMonitor),stillOnlyIfMoved/stillMoveMeters/stillHeartbeatMs,keepAlive(one sharedHttpClient,KeepAliveHttpPoster); flush on motion change and manual send; JSON-array requests of up tomax(batchSize, syncThreshold);flushQueue(). - Low power when still.
MotionConfig:balancedWhileStillnow defaults to true,stillIntervalMs30 s,stillMinDistanceMeters20 (Android min update distance / iOS distanceFilter),stillIosAccuracy(hundredMeters); updates are never stopped; the stale-fix watchdog no longer fires in this mode.
P1
PROVIDERS_CHANGED_ACTIONreceiver:locationDisabled/locationEnabledstatus, watchdog paused, notification text updated, provider re-armed.- Android 14 dismissible notification:
deleteIntentre-posts it + statusnotificationDismissed(NotificationConfig.repostOnDismiss). DartPluginRegistrant.ensureInitialized()in the background entry point.- iOS: queue flushes wrapped in
beginBackgroundTask/endBackgroundTask; optionalBGAppRefreshTask(FlutterGetBackgroundLocPlugin.registerBackgroundRefresh(identifier:)). - iOS
requestTemporaryFullAccuracy(purposeKey); fixes under reduced accuracy carryreducedAccuracyand are alwaysquality = coarse. - Android first fix:
setMaxUpdateAgeMillis(0)+setWaitForAccurateLocation(true)until the first fix (max 30 s).
P2
altitudeMsl/altitudeMslAccuracy(Android 14+).- iOS 17
CLBackgroundActivitySession(IosConfig.useBackgroundActivitySession).
Example app: power/batching/restart card, Wi-Fi-only, sync threshold, still-gating and wake-lock switches,
exact-alarm / flush / full-accuracy buttons, BGAppRefreshTask registered. Indonesian README updated.
Changed defaults: useWakeLock false, MotionConfig.balancedWhileStill true, stillIntervalMs 30 s. Unchanged: stopWithTask=false, START_STICKY,
foregroundServiceType=location, no QUERY_ALL_PACKAGES.
0.4.0 #
Indoor / high-rise accuracy (Dart core + Android + iOS, no third-party packages).
- Degraded output path. New
FixQuality {good, degraded, coarse, held}on everyLocationFixand payload. Fixes up toindoor.coarseMaxAccuracyMeters(50 m) are accepted ascoarse(EKF R from hAcc); rejected fixes re-emit the last good filtered fix asheldwithageMsand accuracyacc + k*sqrt(age). vAcc is no longer a hard gate by default (maxVerticalAccuracyMeters: null, confidence only viaverticalConfidenceMeters). Gap resets are skipped while the IMU says still. Upload policy:uploadCoarse(true),uploadHeld(false),heldUploadIntervalMs. - Stationary anchor. After
anchorAfterStillMsof IMU/activity stillness the position freezes at the accuracy-weighted mean of recent good fixes (zero velocity, tiny Q); exit needs motion evidence and consecutive fixes outsidemax(25 m, 2*acc). - Safer EKF re-init. Unconditional re-init is gone (when
indoor.enabled): only agreeing rejected fixes, each accuracy <= 15 m, with IMU/activity motion; otherwise hold and inflate P (capped byreinitMaxInflation). - Mock heuristic.
imuStationaryButMovedis suppressed whenindoorLikelyor the jump is <driftAccuracyFactorx accuracy; reported as reasonindoorDrift(no score). - Indoor likelihood.
IndoorScorer->indoorLikely,indoorScore,indoorReasons(sats used, CN0, visible-vs-used, accuracy, non-GPS provider, IMU still). - Activity recognition from scratch. Android Activity Recognition Transition API (receiver +
ACTIVITY_RECOGNITIONpermission helper), iOSCMMotionActivityManager(NSMotionUsageDescription). Stop-timeout state machine (MotionConfig.stopTimeoutMs, default 3 min), optional balanced priority while still, watchdog re-registration. PublicrejectedFixStream(RejectedFixwith reason),motionStream,heartbeatStream(background isolate, default every 60 s, optionally uploaded). New methodscheckActivityRecognitionPermission,requestActivityRecognitionPermission. - Barometer. Android
TYPE_PRESSURE+SensorManager.getAltitude, iOSCMAltimeter:pressureHpa,relativeAltitude,floorChange(~3 m/floor),floorwithcalibrateFloor(n),verticalMotion(lift/stairs) andverticalSpeed. Graceful when the sensor is absent. - Example app: quality, indoor score/reasons, motion state, floor, rejected-fix log, heartbeat, activity permission and floor calibration. Indonesian README updated.
- Unchanged:
stopWithTask=false,START_STICKY,foregroundServiceType=location, noQUERY_ALL_PACKAGES.
0.3.0 #
- OEM battery-killer handling, written from scratch (no third-party packages) on the plugin's own
MethodChannel:
isBatteryOptimizationIgnored,requestDisableBatteryOptimization,getManufacturer,needsOemAutostart,openOemAutostartSettings(returnsOemSettingsResult: vendor page / app-details fallback / none). LegacyisIgnoringBatteryOptimizations/requestIgnoreBatteryOptimizationsremain as aliases. - Native
OemHelper: per-vendor candidate component lists (Xiaomi, Oppo/Realme incl. ColorOS/oplus, Vivo/iQOO, Huawei/Honor, Samsung Device Care, OnePlus, Asus, Letv, HTC, Nokia, Transsion, Meizu),resolveActivity+ try/catch,ACTION_APPLICATION_DETAILS_SETTINGSfallback. Plugin manifest gains a<queries>block for those packages (noQUERY_ALL_PACKAGES). - Dart
OemBackgroundHelper.ensureBackgroundPermission(context, ...): standard request (waits for the user to return), then a themeable Indonesian guide dialog with vendor-specific steps, custom texts/steps/builder, and a natively persisted "user confirmed" flag (force/resetGuide()). - iOS: all of the above are no-ops. Example app: "Battery / Autostart" button + auto prompt on Start.
stopWithTask=false,START_STICKY,foregroundServiceType=locationunchanged (verified in the merged manifest).
0.2.0 #
- Breaking: single-owner pipeline. Native (Kotlin/Swift) only streams raw fixes to a headless
background Dart isolate (
flutterGetBackgroundLocBackgroundMain), which owns all filtering and HTTP upload. Native filter and native uploaders removed;SendMode.nativeremoved (legacy value maps todart),getQueueSize()removed. - Kinematic Adaptive EKF (
[px, py, vx, vy]local ENU, adaptive R/Q, Mahalanobis gating, Joseph update, speed-only and zero-velocity updates) replaces the constant-velocity Kalman. - Null-safe quality gating: HDOP only trusted with >= 4 satellites; otherwise pure accuracy fallback. New vertical accuracy (20 m) and speed jump (150 km/h) gates. Default hAcc gate 15 m.
- Fake GPS: IMU-vs-GNSS heuristic (SensorManager / CoreMotion), teleport check,
mockScoreandmockReasons; Play Integrity standard token request (requestIntegrityToken, Android). - Android: Doppler pseudorange-rate uncertainty metric; health reports background isolate / IMU.
- iOS: dynamic geofence + significant change relaunch after force-quit,
FlutterGetBackgroundLocPlugin.restoreOnLaunch(). - Persistent JSON-lines upload queue with exponential backoff + jitter in Dart.
0.1.0 #
- Initial release.
- Android: foreground service (type
location) with persistent notification, partial WakeLock,START_STICKY, restart after task removal (AlarmManager), optional boot restart, watchdog. - Fused (high accuracy) provider with raw GPS fallback; GnssStatus satellites / CN0 / HDOP;
GnssMeasurements with
setFullTracking(true)(Android 12+) and TOW-decoded + code-lock gating. - Fake GPS detection (
isMock,isFromMockProvider, heuristics, developer options hint). - iOS: background location updates, significant-change relaunch,
isSimulatedBySoftware. - Dart filter engine: warm-up buffer, HDOP / accuracy / spike gating, constant-velocity Kalman filter with Doppler velocity and multipath jump rejection (mirrored natively).
- Native HTTP sender with persistent offline queue and exponential backoff; optional Dart sender.
- Example field console app.