-
Notifications
You must be signed in to change notification settings - Fork 441
5.0.0 beta #2465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
christocracy
wants to merge
36
commits into
master
Choose a base branch
from
5.0.0-beta
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
5.0.0 beta #2465
Conversation
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.
π Migration Guide: Flat Config β Compound Config
π’ Overview
Version 5 introduces a new Compound Config format that replaces the legacy βflatβ config structure. This guide explains how to migrate, shows before/after examples, and highlights key differences for the React Native SDK.
βοΈ Compatibility
The legacy flat config style remains fully supported for backward compatibility.
You can continue using your existing flat configuration if you prefer, though new features may only appear in the compound structure.
β© Why Compound Config?
@transistorsoft/background-geolocation-types.ποΈ Old vs. New Config Structure (React Native)
Before (Flat Config β JS/TS)
After (Compound Config)
πΊοΈ Mapping Table: Flat β Compound
desiredAccuracygeolocationdesiredAccuracygeolocation: GeoConfig(desiredAccuracy: ...)distanceFiltergeolocationdistanceFilterstopOnTerminateappstopOnTerminateapp: AppConfig(stopOnTerminate: ...)startOnBootappstartOnBooturlhttpurlhttp: HttpConfig(url: ...)headershttpheaderslogLevelloggerlogLevellogger: LoggerConfig(logLevel: ...)debugloggerdebugπ§βπ» Migration Steps
Update your dependency:
Ensure you are using
flutter_background_geolocationv5.0.0 or later.Import new config classes:
Group related options:
GeoConfigHttpConfigLoggerConfigAppConfigActivityConfigPersistenceConfigReplace flat keys:
Config(...)directly, pass the relevant compound config objects.Check for breaking changes:
π Example Migration
Flat Config (Old)
Compound Config (New)
π§© Compound Config Groups
geolocationGeoConfigappAppConfighttpHttpConfigloggerLoggerConfigactivityActivityConfigpersistencePersistenceConfigEach group is a separate Dart class. See API docs for details.
π οΈ Full Mapping Table
desiredAccuracygeolocationdesiredAccuracydistanceFiltergeolocationdistanceFilterstationaryRadiusgeolocationstationaryRadiusstopTimeoutgeolocationstopTimeoutstopAfterElapsedMinutesgeolocationstopAfterElapsedMinutesgeofenceProximityRadiusgeolocationgeofenceProximityRadiusgeofenceInitialTriggerEntrygeolocationgeofenceInitialTriggerEntrygeofenceModeHighAccuracygeolocationgeofenceModeHighAccuracypausesLocationUpdatesAutomaticallygeolocationpausesLocationUpdatesAutomaticallyshowsBackgroundLocationIndicatorgeolocationshowsBackgroundLocationIndicatoractivityTypegeolocationactivityTypelocationAuthorizationAlertgeolocationlocationAuthorizationAlertmaxMonitoredGeofencesgeolocationmaxMonitoredGeofencesfiltergeolocationfilterstopOnTerminateappstopOnTerminatestartOnBootappstartOnBootenableHeadlessappenableHeadlessheartbeatIntervalappheartbeatIntervalscheduleappschedulescheduleUseAlarmManagerappscheduleUseAlarmManagernotificationappnotificationbackgroundPermissionRationaleappbackgroundPermissionRationalepreventSuspendapppreventSuspendurlhttpurlautoSynchttpautoSyncautoSyncThresholdhttpautoSyncThresholddisableAutoSyncOnCellularhttpdisableAutoSyncOnCellularbatchSynchttpbatchSyncmaxBatchSizehttpmaxBatchSizemethodhttpmethodparamshttpparamsheadershttpheadersrootProperty/httpRootPropertyhttprootPropertytimeout/httpTimeouthttptimeoutdebugloggerdebuglogLevelloggerlogLevelLogLevellogMaxDaysloggerlogMaxDaysactivityRecognitionIntervalactivityactivityRecognitionIntervalminimumActivityRecognitionConfidenceactivityminimumActivityRecognitionConfidencedisableStopDetectionactivitydisableStopDetectionstopOnStationaryactivitystopOnStationarymotionTriggerDelayactivitymotionTriggerDelaytriggerActivitiesactivitytriggerActivitiesdisableMotionActivityUpdatesactivitydisableMotionActivityUpdatesstopDetectionDelayactivitystopDetectionDelaypersistModepersistencepersistModemaxDaysToPersistpersistencemaxDaysToPersistmaxRecordsToPersistpersistencemaxRecordsToPersistlocationsOrderDirectionpersistencelocationsOrderDirectionlogLevelis now aLogLevelenum (e.g.,LogLevel.info), but legacy integer values are still supported for backward compatibility. You may use either the new enum or the legacy integer type.debugis now inLoggerConfig.π§ͺ Testing Your Migration
π Need Help?
π Resources
π Happy Migrating!
If you have suggestions for improving this guide, please open a PR or issue.