diff --git a/RadarSDK/RadarLocationManager.m b/RadarSDK/RadarLocationManager.m index 514506869..121b51d22 100644 --- a/RadarSDK/RadarLocationManager.m +++ b/RadarSDK/RadarLocationManager.m @@ -583,7 +583,7 @@ - (void)replaceSyncedGeofences:(NSArray *)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; @@ -619,13 +619,15 @@ - (void)replaceSyncedGeofences:(NSArray *)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 *)beacons { @@ -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]; +} + - (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading { [RadarState setLastHeadingData:@{ @"magneticHeading" : @(newHeading.magneticHeading), diff --git a/RadarSDK/RadarNotificationHelper.m b/RadarSDK/RadarNotificationHelper.m index 917686567..778b504fd 100644 --- a/RadarSDK/RadarNotificationHelper.m +++ b/RadarSDK/RadarNotificationHelper.m @@ -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];