v5.0.0 #2431
Replies: 16 comments 21 replies
-
|
Migration Steps
Typo? References to Dart? |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, fixed. |
Beta Was this translation helpful? Give feedback.
-
|
I'll be publishing |
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
(both iOS and Android now require a key)
|
Beta Was this translation helpful? Give feedback.
-
|
Published |
Beta Was this translation helpful? Give feedback.
-
|
Published v5.0.0-beta.3 with Expo fixes and updated Setup Instructions. |
Beta Was this translation helpful? Give feedback.
-
|
FYI after upgrading to 5-beta I had a conflict of the The error was: After uninstalling react-native-background-fetch, the build worked (did not do further tests yet). |
Beta Was this translation helpful? Give feedback.
-
|
I'm having some trouble migrating to 5.x.x. I'm on
I've tried cleaning my build and reinstalling dependencies but it keeps giving me this message. I get a similar message when trying to upload logs too. For additional context, I'm accessing the logger like so: and then trying to record logs with: |
Beta Was this translation helpful? Give feedback.
-
|
@joegrabski I'm looking into the Logger issue. It seems to have been neglected. |
Beta Was this translation helpful? Give feedback.
-
|
After upgrading to 5.0.3 from 4.19.3 I am unable to test in simulator when I try to simulate the location it does not move |
Beta Was this translation helpful? Give feedback.
-
|
Is this |
Beta Was this translation helpful? Give feedback.
-
|
Is auth handled the same in v5? For me the library is receiving a 2xx code from our refresh token endpoint, but then it's not using the returned token in subsequent requests. |
Beta Was this translation helpful? Give feedback.
-
|
I'm not seeing a clear mapping for "locationTemplate" My api expects a certain JSON schema and I would send that by using the config locationTemplate: '{"latitude":<%= latitude %>,"longitude":<%= longitude %>, "age": <%= age %>}', Looks like the "params" property just appends additional params to the location request, but doesn't allow you to override where a location value gets set. |
Beta Was this translation helpful? Give feedback.
-
|
Why is isShrinkResources required as false? We are currently using it and we don't like the idea of having to set it to false. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @christocracy we want to thank you for your continued effort into improving bg geolocation 👍 Very much appreciated. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
🚀 Migration Guide: Flat Config → Compound Config
See the README in the
5.0.0-betabranch.📢 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
react-native-background-geolocationv5.0.0 or later.Import as before:
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 Typescript interface. See API docs for details.
🛠️ Full Mapping Table
desiredAccuracygeolocationdesiredAccuracydistanceFiltergeolocationdistanceFilterstationaryRadiusgeolocationstationaryRadiusstopTimeoutgeolocationstopTimeoutstopAfterElapsedMinutesgeolocationstopAfterElapsedMinutesgeofenceProximityRadiusgeolocationgeofenceProximityRadiusgeofenceInitialTriggerEntrygeolocationgeofenceInitialTriggerEntrygeofenceModeHighAccuracygeolocationgeofenceModeHighAccuracypausesLocationUpdatesAutomaticallygeolocationpausesLocationUpdatesAutomaticallyshowsBackgroundLocationIndicatorgeolocationshowsBackgroundLocationIndicatoractivityTypegeolocationactivityTypelocationAuthorizationAlertgeolocationlocationAuthorizationAlertmaxMonitoredGeofencesgeolocationmaxMonitoredGeofencesfiltergeolocationfilterstopOnTerminateappstopOnTerminatestartOnBootappstartOnBootenableHeadlessappenableHeadlessheartbeatIntervalappheartbeatIntervalscheduleappschedulescheduleUseAlarmManagerappscheduleUseAlarmManagernotificationappnotificationbackgroundPermissionRationaleappbackgroundPermissionRationalepreventSuspendapppreventSuspendurlhttpurlautoSynchttpautoSyncautoSyncThresholdhttpautoSyncThresholddisableAutoSyncOnCellularhttpdisableAutoSyncOnCellularbatchSynchttpbatchSyncmaxBatchSizehttpmaxBatchSizemethodhttpmethodparamshttpparamsheadershttpheadersrootProperty/httpRootPropertyhttprootPropertytimeout/httpTimeouthttptimeoutdebugloggerdebuglogLevelloggerlogLevelLogLevellogMaxDaysloggerlogMaxDaysactivityRecognitionIntervalactivityactivityRecognitionIntervalminimumActivityRecognitionConfidenceactivityminimumActivityRecognitionConfidencedisableStopDetectionactivitydisableStopDetectionstopOnStationaryactivitystopOnStationarymotionTriggerDelayactivitymotionTriggerDelaytriggerActivitiesactivitytriggerActivitiesdisableMotionActivityUpdatesactivitydisableMotionActivityUpdatesstopDetectionDelayactivitystopDetectionDelaypersistModepersistencepersistModemaxDaysToPersistpersistencemaxDaysToPersistmaxRecordsToPersistpersistencemaxRecordsToPersistlocationsOrderDirectionpersistencelocationsOrderDirectionNew License Key Format
A new license key format has been introduced for
v5. Also, iOS now requires a license key. Generate your new license keys in the Customer Dashboard. See the usual Setup Guides for license setup instructions.logLevelis 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.
Beta Was this translation helpful? Give feedback.
All reactions