feat(ios): Life360-style battery profile (0.4.0)#12
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
iOS-native power management matching the Life360 playbook:
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)desiredAccuracyrelaxes tokCLLocationAccuracyNearestTenMeters, restoring below 7 m/s (hysteresis avoids flapping at city speeds). (speedAdaptiveAccuracy, default on)lowBatterySlcOnly/lowBatteryThreshold)pausesLocationUpdatesAutomaticallymade safe —locationManagerDidPauseLocationUpdatesnow 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.LocationServiceConfigdecodes 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.Version 0.4.0 + changelog. No breaking API changes; new
NativeConfigflags 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: cleanflutter test: 75/75 passexample/:flutter build ios --simulatorcompiles the new Swift cleanly🤖 Generated with Claude Code