Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions RadarSDK/RadarLocationManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ - (void)replaceSyncedGeofences:(NSArray<RadarGeofence *> *)geofences {
[self.locationManager startMonitoringForRegion:region];

[[RadarLogger sharedInstance] logWithLevel:RadarLogLevelDebug
message:[NSString stringWithFormat:@"Synced geofence | latitude = %f; longitude = %f; radius = %f; identifier = %@",
message:[NSString stringWithFormat:@"Synced geofence | latitude = %f; longitude = %f; radius = %f; identifier = %@",
center.coordinate.latitude, center.coordinate.longitude, radius, identifier]];

NSDictionary *metadata = geofence.metadata;
Expand Down Expand Up @@ -619,13 +619,15 @@ - (void)replaceSyncedGeofences:(NSArray<RadarGeofence *> *)geofences {
}

- (void)removeSyncedGeofences {
NSMutableArray *identifiersToRemove = [NSMutableArray new];
for (CLRegion *region in self.locationManager.monitoredRegions) {
if ([region.identifier hasPrefix:kSyncGeofenceIdentifierPrefix]) {
[self.locationManager stopMonitoringForRegion:region];
}
[identifiersToRemove addObject:region.identifier];
}

[[RadarLogger sharedInstance] logWithLevel:RadarLogLevelDebug message:@"Removed synced geofences"];
[[RadarLogger sharedInstance] logWithLevel:RadarLogLevelDebug message:[NSString stringWithFormat:@"Removed synced geofences | identifiers = %@", [identifiersToRemove componentsJoinedByString:@", "]]];
}

- (void)replaceSyncedBeacons:(NSArray<RadarBeacon *> *)beacons {
Expand Down Expand Up @@ -1212,6 +1214,11 @@ - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *
[self callCompletionHandlersWithStatus:RadarStatusErrorLocation location:nil];
}

- (void)locationManager:(CLLocationManager *)manager monitoringDidFailForRegion:(CLRegion *)region withError:(NSError *)error {
[[RadarLogger sharedInstance] logWithLevel:RadarLogLevelDebug message:[NSString stringWithFormat:@"CLLocation manager region monitoring error | error = %@", error]];
[[RadarDelegateHolder sharedInstance] didFailWithStatus:RadarStatusErrorLocation];
}
Comment on lines +1217 to +1220
Copy link
Contributor

Choose a reason for hiding this comment

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

Keep this.


- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading {
[RadarState setLastHeadingData:@{
@"magneticHeading" : @(newHeading.magneticHeading),
Expand Down
2 changes: 1 addition & 1 deletion RadarSDK/RadarNotificationHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ + (void)removePendingNotificationsWithPrefix:(NSString *)prefix completionHandle
[userInfosToKeep addObject:request.content.userInfo];
}
}
[[RadarLogger sharedInstance] logWithLevel:RadarLogLevelDebug message:[NSString stringWithFormat:@"Found %lu pending notifications to remove", (unsigned long)identifiersToRemove.count]];
[[RadarLogger sharedInstance] logWithLevel:RadarLogLevelDebug message:[NSString stringWithFormat:@"Found %lu pending notifications to remove: %@", (unsigned long)identifiersToRemove.count, [identifiersToRemove componentsJoinedByString:@", "]]];
[RadarState setRegisteredNotifications:userInfosToKeep];
if (identifiersToRemove.count > 0) {
[notificationCenter removePendingNotificationRequestsWithIdentifiers:identifiersToRemove];
Expand Down