Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces an "efficient tracking" mode that reduces API calls by performing local state change detection for geofences, beacons, and places. When enabled via new tracking option flags, the SDK only makes /track API calls when it detects entry/exit events locally, significantly reducing network traffic.
Changes:
- Adds three new boolean flags to
RadarTrackingOptions:syncOnGeofenceEvents,syncOnPlaceEvents, andsyncOnBeaconEvents - Implements
RadarEfficientTrackManagerclass with local point-in-circle detection and state change comparison logic - Adds state persistence for nearby geofences, beacons, places, and a synced region to
RadarState - Integrates efficient tracking checks into
RadarLocationManagerto conditionally skip /track API calls - Includes comprehensive unit tests for the new efficient tracking functionality
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| RadarSDK/Include/RadarTrackingOptions.h | Added public API declarations for three new sync flags |
| RadarSDK/RadarTrackingOptions.m | Implemented serialization, deserialization, and equality checks for new flags; initialized them to NO in all presets |
| RadarSDK/RadarEfficientTrackManager.h | New header defining the efficient tracking manager interface with methods for state detection and location checks |
| RadarSDK/RadarEfficientTrackManager.m | New implementation of local geofence/beacon/place detection using point-in-circle calculations and state comparison |
| RadarSDK/RadarState.h | Added declarations for persisting nearby geofences, beacons, places, and synced region |
| RadarSDK/RadarState.m | Implemented persistence methods for new cached data; fixed placeId type signature from array to string |
| RadarSDK/RadarLocationManager.h | Exposed updateSyncedRegion method |
| RadarSDK/RadarLocationManager.m | Integrated efficient tracking check before /track calls; added caching of nearby entities from API responses; implemented synced region calculation |
| RadarSDK/RadarUtils.h | Changed import to full CoreLocation framework; added circular region serialization methods |
| RadarSDK/RadarUtils.m | Implemented serialization/deserialization for CLCircularRegion |
| RadarSDK/RadarGeofence.m | Added case-insensitive support for "Circle" geometry type |
| RadarSDKTests/RadarSDKTests.m | Added 24 comprehensive unit tests covering efficient tracking scenarios |
| RadarSDK.xcodeproj/project.pbxproj | Added new EfficientTrackManager files to build configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ShiCheng-Lu
reviewed
Jan 29, 2026
| [self replaceSyncedGeofences:nearbyGeofences]; | ||
| [self cacheNearbyEntitiesFromResponse:res]; | ||
| }]; | ||
| }]; |
Contributor
There was a problem hiding this comment.
we can just delete this
ShiCheng-Lu
reviewed
Jan 29, 2026
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
Adds a new "efficient tracking" mode that reduces API calls by performing local state change detection on the device. When enabled, the SDK only makes /track API calls when it detects a geofence, place, or beacon entry/exit locally, significantly reducing network traffic and server load for users with many geofences.
New Features
New
RadarTrackingOptionsflags:syncOnGeofenceEvents- Only sync when geofence entry/exit detectedsyncOnPlaceEvents- Only sync when place entry/exit detectedsyncOnBeaconEvents- Only sync when beacon entry/exit detectedNew
RadarEfficientTrackManagerclass that handles local state detection:How It Works
nearbyGeofences: Geofences near the usernearbyBeacons: Beacons near the usernearbyPlaces: Places near the usersyncedRegion: A circular region where the cached data is valid/trackcall if state has changed (entry or exit detected)/trackcall is always made to refresh cached data