Skip to content

Conversation

@ShiCheng-Lu
Copy link
Contributor

@ShiCheng-Lu ShiCheng-Lu commented Oct 17, 2025

Improve nearby geofence syncing logic

only remove/add when necessary to avoid removing and re-adding nearby geofences at each track.

Also added radar:notificationRepeats to campaignMetadata (added after original implmentation of repeats)
notification will prioritize geofence's notificationRepeats if set (since it's more granular), and fallback to campaign's notificationRepeats, then fallback to false / no-repeat

@available(iOS 13.0, *)
actor IOActor {
static let shared = IOActor()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using this Actor for thread safety, this is a background actor

@ShiCheng-Lu ShiCheng-Lu marked this pull request as ready for review October 20, 2025 16:34
@Copilot Copilot AI review requested due to automatic review settings October 20, 2025 16:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements an improved geofence synchronization logic for the RadarSDK, introducing a new Swift-based location manager to handle geofence and notification management more efficiently. The changes add a feature flag (useImprovedSyncLogic) that allows toggling between the old and new synchronization approaches, with the new logic providing better tracking of registered notifications and more granular control over region monitoring.

Key Changes:

  • Introduced RadarLocationManager.swift with improved geofence and notification sync logic
  • Added useImprovedSyncLogic feature flag to RadarSdkConfiguration
  • Enhanced notification diff tracking with better logging and state management

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
RadarSDK/RadarLocationManager.swift New Swift implementation of location manager with improved geofence/notification sync logic
RadarSDK/RadarState.swift New Swift wrapper for accessing registered notifications from UserDefaults
RadarSDK/RadarLocationManager.m Integration point to call new Swift implementation when feature flag is enabled
RadarSDK/RadarSettings.m Clears existing geofences/notifications when transitioning to new sync logic
RadarSDK/RadarSdkConfiguration.m/h Adds useImprovedSyncLogic feature flag property
RadarSDK/RadarState.m Changes notification storage from NSMutableArray to NSMutableSet to prevent duplicates
RadarSDK/RadarNotificationHelper.m Enhanced logging for notification diff processing
RadarSDK/RadarAPIClient.m Fixed variable name from notificationsDelivered to notificationsRemaining
set_version.sh Commented out version updates for RadarSDKIndoors
Example files Added SwiftUI example interface and test waypoints
Comments suppressed due to low confidence (1)

RadarSDK/RadarLocationManager.swift:1

  • [nitpick] Consider using optional chaining to simplify the condition: if sdkConfiguration.useImprovedSyncLogic && old?.useImprovedSyncLogic != true. This is more concise and handles the nil case naturally.
//

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants