Skip to content

feat(ios): Life360-style battery profile (0.4.0)#12

Merged
rez-bingbong merged 1 commit into
mainfrom
feat/life360-battery-profile
Jun 11, 2026
Merged

feat(ios): Life360-style battery profile (0.4.0)#12
rez-bingbong merged 1 commit into
mainfrom
feat/life360-battery-profile

Conversation

@rez-bingbong

Copy link
Copy Markdown
Collaborator

What changed

iOS-native power management matching the Life360 playbook:

  • Motion-driven GPS re-arming — a confident CMMotionActivity (walking/running/cycling/automotive) while stationary re-arms continuous GPS immediately instead of waiting for an SLC tick or geofence exit. Raw accelerometer still never wakes GPS. (motionActivityWake, default on)
  • Speed-adaptive accuracy — at driving speed (≥10 m/s) desiredAccuracy relaxes to kCLLocationAccuracyNearestTenMeters, restoring below 7 m/s (hysteresis avoids flapping at city speeds). (speedAdaptiveAccuracy, default on)
  • Low-battery SLC-only mode — battery ≤20% and not charging drops to significant-location-changes only regardless of motion; restores on charge or ≥25%. SLC fixes still emit while in power save. (lowBatterySlcOnly / lowBatteryThreshold)
  • pausesLocationUpdatesAutomatically made safelocationManagerDidPauseLocationUpdates now folds the native pause into the plugin's stationary mode (SLC + exit geofence armed), so streaming resumes on movement. The Dart low/balanced presets already set this flag true; before this change a native pause could silently stall updates until the stillness timeout.
  • Upgrade-safe persisted configLocationServiceConfig decodes field-by-field with defaults. Previously any new config field made the persisted JSON fail decoding wholesale, silently breaking tracking restore after app termination on plugin upgrades.
  • Android accepts and ignores the new keys (its foreground-service power model is unchanged).

Version 0.4.0 + changelog. No breaking API changes; new NativeConfig flags opt out.

Follow-up after publish: bump Grid-Mobile to libre_location: ^0.4.0 (caret on 0.x won't resolve 0.4.0 from ^0.3.0).

Verification

  • flutter analyze: clean
  • flutter test: 75/75 pass
  • example/: flutter build ios --simulator compiles the new Swift cleanly

🤖 Generated with Claude Code

…ive accuracy, low-battery SLC-only

- CMMotionActivity re-arms GPS when stationary (motionActivityWake)
- desiredAccuracy relaxes to NearestTenMeters at driving speed with
  hysteresis (speedAdaptiveAccuracy)
- battery <=20% and not charging drops to SLC-only regardless of motion,
  restores on charge or 25% (lowBatterySlcOnly / lowBatteryThreshold)
- locationManagerDidPauseLocationUpdates folds the native pause into
  stationary mode so pausesLocationUpdatesAutomatically is safe
- persisted config decodes field-by-field so plugin upgrades no longer
  break tracking restore
- bump 0.4.0 + changelog
@rez-bingbong rez-bingbong merged commit 29284f8 into main Jun 11, 2026
3 checks passed
@rez-bingbong rez-bingbong deleted the feat/life360-battery-profile branch June 11, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant