chore: register geofence module with native SDKs#355
Open
mrehan27 wants to merge 1 commit into
Open
Conversation
Contributor
Sample app builds 📱Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request. |
0c03543 to
b36030a
Compare
cbdda98 to
168c84a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 168c84a. Configure here.
Wires the geofence module into the native SDK builders during initialize() on Android and iOS. Geofence runs automatically once registered and depends on the location module, which is registered (with the app's config or defaults) whenever geofence is enabled. iOS guards against a Flutter-null 'geofence' key (NSNull) by casting to a dictionary, so geofence/location are only registered when a GeofenceConfig is actually provided. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
168c84a to
8d7653e
Compare
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.

Summary
Wires the geofence module into the native SDK builders during
initialize()on Android and iOS. Geofence runs automatically once registered (no Flutter-facing methods) and depends on the Location module, which is registered — with the app's config if provided, otherwise defaults (manual) — whenever geofence is enabled.CustomerIOGeofencebridge registersModuleGeofence; the reference is isolated in its own class so a disabled/compileOnly dependency can't triggerNoClassDefFoundError.initialize()registers Location when either location or geofence is configured.initialize()addsGeofenceModule()plusLocationModuleunder thecanImportguards.Ticket
MBL-1783 — Flutter: add geofencing support
PR stack
feature/geofence-on-device(chore: add geofence module build enablement and config #354)Testing
flutter analyze+ unit tests pass. Validated by building both sample apps against local geofence natives: Android APK links thegeofenceartifact; iOSRunner.applinksCioLocationGeofence.framework.Note
Medium Risk
Changes SDK initialization and location/geofence registration, which affects background location behavior when geofence is enabled; mitigated by compile-time flags and isolated bridge classes on Android.
Overview
Geofencing is wired into native SDK setup on Android and iOS so it starts automatically when the Flutter app passes a
geofenceblock ininitialize()(no new Dart method channel API).On Android, an optional
CustomerIOGeofencebridge is added to the plugin module list whenCIO_GEOFENCE_ENABLEDis on;initialize()registersModuleGeofencevia that bridge. Location is now configured when eitherlocationorgeofenceis present (geofence-only apps still get location with defaults), still guarded byCIO_LOCATION_ENABLEDso optional native artifacts are not referenced when disabled.On iOS,
initialize()registersGeofenceModule()whengeofenceis in the init params (canImport(CioLocationGeofence)), and registersLocationModulewhenlocationor geofence is configured, using location tracking mode fromlocationor defaulting to manual.Reviewed by Cursor Bugbot for commit 8d7653e. Bugbot is set up for automated code reviews on this repo. Configure here.