Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// swift-tools-version:5.3
import PackageDescription

let version = "3.23.2"
let version = "3.23.3-beta.2"

let package = Package(
name: "RadarSDK",
Expand Down
2 changes: 1 addition & 1 deletion RadarSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'RadarSDK'
s.version = '3.23.2'
s.version = '3.23.3-beta.2'
s.summary = 'iOS SDK for Radar, the leading geofencing and location tracking platform'
s.homepage = 'https://radar.com'
s.author = { 'Radar Labs, Inc.' => '[email protected]' }
Expand Down
4 changes: 2 additions & 2 deletions RadarSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 3.23.2;
MARKETING_VERSION = 3.23.3;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -1187,7 +1187,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 3.23.2;
MARKETING_VERSION = 3.23.3;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_CFLAGS = "-fembed-bitcode";
Expand Down
22 changes: 17 additions & 5 deletions RadarSDK/RadarLocationManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -580,11 +580,8 @@ - (void)replaceSyncedGeofences:(NSArray<RadarGeofence *> *)geofences {
}
if (center) {
CLRegion *region = [[CLCircularRegion alloc] initWithCenter:center.coordinate radius:radius identifier:identifier];
[self.locationManager startMonitoringForRegion:region];

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



NSDictionary *metadata = geofence.metadata;
if (metadata) {
Expand All @@ -610,7 +607,16 @@ - (void)replaceSyncedGeofences:(NSArray<RadarGeofence *> *)geofences {
[requests addObject:request];
} else {
[[RadarLogger sharedInstance] logWithLevel:RadarLogLevelDebug message:[NSString stringWithFormat:@"No notification text for geofence | geofenceId = %@", geofenceId]];
[self.locationManager startMonitoringForRegion:region];
[[RadarLogger sharedInstance] logWithLevel:RadarLogLevelDebug
message:[NSString stringWithFormat:@"Synced geofence | latitude = %f; longitude = %f; radius = %f; identifier = %@",
center.coordinate.latitude, center.coordinate.longitude, radius, identifier]];
}
} else {
[self.locationManager startMonitoringForRegion:region];
[[RadarLogger sharedInstance] logWithLevel:RadarLogLevelDebug
message:[NSString stringWithFormat:@"Synced geofence | latitude = %f; longitude = %f; radius = %f; identifier = %@",
center.coordinate.latitude, center.coordinate.longitude, radius, identifier]];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

yeah this is fine for costco, but in general I think even if a geofence has notification, it still should be tracked by regions unless specifically marked not to be track. The super simple example is if I have a store and a geofence around it, I make a notification campaign attached to my store geofence. I'd want the notification to get pushed, but still want the region to create a user location on the dashboard.

}
}
Expand All @@ -620,6 +626,7 @@ - (void)replaceSyncedGeofences:(NSArray<RadarGeofence *> *)geofences {

- (void)removeSyncedGeofences {
for (CLRegion *region in self.locationManager.monitoredRegions) {
[[RadarLogger sharedInstance] logWithLevel:RadarLogLevelDebug message:[NSString stringWithFormat:@"Encountering monitored geofence | identifier = %@", region.identifier]];
Copy link
Contributor

Choose a reason for hiding this comment

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

this and line 255 of notification helper would be too noisy in logs. but the monitoringDidFail logging should be brought in to the main sdk certainly. is there a registeringNotificationDidFail as well? would be good

if ([region.identifier hasPrefix:kSyncGeofenceIdentifierPrefix]) {
[self.locationManager stopMonitoringForRegion:region];
}
Expand Down Expand Up @@ -1212,6 +1219,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),
Expand Down
1 change: 1 addition & 0 deletions RadarSDK/RadarNotificationHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ + (void)removePendingNotificationsWithPrefix:(NSString *)prefix completionHandle
NSMutableArray *identifiersToRemove = [NSMutableArray new];
NSMutableArray *userInfosToKeep = [NSMutableArray new];
for (UNNotificationRequest *request in requests) {
[[RadarLogger sharedInstance] logWithLevel:RadarLogLevelDebug message:[NSString stringWithFormat:@"Found pending notification | identifier = %@", request.identifier]];
if ([request.identifier hasPrefix:prefix]) {
[identifiersToRemove addObject:request.identifier];
} else {
Expand Down
2 changes: 1 addition & 1 deletion RadarSDK/RadarUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ + (NSNumber *)timeZoneOffset {
}

+ (NSString *)sdkVersion {
return @"3.23.2";
return @"3.23.3-beta.2";
}

+ (NSString *)deviceId {
Expand Down
2 changes: 1 addition & 1 deletion RadarSDKIndoors.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'RadarSDKIndoors'
s.version = '3.23.2'
s.version = '3.23.3-beta.2'
s.summary = 'Indoor positioning plugin for RadarSDK, the leading geofencing and location tracking platform'
s.homepage = 'https://radar.com'
s.author = { 'Radar Labs, Inc.' => '[email protected]' }
Expand Down
2 changes: 1 addition & 1 deletion RadarSDKMotion.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'RadarSDKMotion'
s.version = '3.23.2'
s.version = '3.23.3-beta.2'
s.summary = 'Motion detection plugin for RadarSDK, the leading geofencing and location tracking platform'
s.homepage = 'https://radar.com'
s.author = { 'Radar Labs, Inc.' => '[email protected]' }
Expand Down
4 changes: 2 additions & 2 deletions RadarSDKMotion/RadarSDKMotion.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 3.23.2;
MARKETING_VERSION = 3.23.3;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -348,7 +348,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 3.23.2;
MARKETING_VERSION = 3.23.3;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand Down