Skip to content

Commit f19d9e9

Browse files
KennyHuRadarlmeier
andauthored
FENCE-2350/ make init RadarSdkConfiguration handle null dict on init (#448)
* make init RadarSdkConfiguration handle null dict on init * Bump version --------- Co-authored-by: Liam Meier <[email protected]>
1 parent b3e770b commit f19d9e9

File tree

6 files changed

+24
-18
lines changed

6 files changed

+24
-18
lines changed

RadarSDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'RadarSDK'
3-
s.version = '3.21.4'
3+
s.version = '3.21.5'
44
s.summary = 'iOS SDK for Radar, the leading geofencing and location tracking platform'
55
s.homepage = 'https://radar.com'
66
s.author = { 'Radar Labs, Inc.' => '[email protected]' }

RadarSDK.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@
10621062
GCC_WARN_UNUSED_FUNCTION = YES;
10631063
GCC_WARN_UNUSED_VARIABLE = YES;
10641064
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
1065-
MARKETING_VERSION = 3.21.4;
1065+
MARKETING_VERSION = 3.21.5;
10661066
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
10671067
MTL_FAST_MATH = YES;
10681068
ONLY_ACTIVE_ARCH = YES;
@@ -1120,7 +1120,7 @@
11201120
GCC_WARN_UNUSED_FUNCTION = YES;
11211121
GCC_WARN_UNUSED_VARIABLE = YES;
11221122
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
1123-
MARKETING_VERSION = 3.21.4;
1123+
MARKETING_VERSION = 3.21.5;
11241124
MTL_ENABLE_DEBUG_INFO = NO;
11251125
MTL_FAST_MATH = YES;
11261126
OTHER_CFLAGS = "-fembed-bitcode";

RadarSDK/RadarSdkConfiguration.m

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,68 +21,74 @@ - (instancetype)initWithDict:(NSDictionary *)dict {
2121
return nil;
2222
}
2323

24-
NSObject *logLevelObj = dict[@"logLevel"];
24+
// Set default values
2525
_logLevel = RadarLogLevelInfo;
26+
_startTrackingOnInitialize = NO;
27+
_trackOnceOnAppOpen = NO;
28+
_usePersistence = NO;
29+
_extendFlushReplays = NO;
30+
_useLogPersistence = NO;
31+
_useRadarModifiedBeacon = NO;
32+
_useLocationMetadata = NO;
33+
_useOpenedAppConversion = NO;
34+
_useForegroundLocationUpdatedAtMsDiff = NO;
35+
_useNotificationDiff = NO;
36+
37+
if (dict == nil) {
38+
return self;
39+
}
40+
41+
NSObject *logLevelObj = dict[@"logLevel"];
2642
if (logLevelObj && [logLevelObj isKindOfClass:[NSString class]]) {
2743
_logLevel = [RadarLog levelFromString:(NSString *)logLevelObj];
2844
}
2945

3046
NSObject *startTrackingOnInitializeObj = dict[@"startTrackingOnInitialize"];
31-
_startTrackingOnInitialize = NO;
3247
if (startTrackingOnInitializeObj && [startTrackingOnInitializeObj isKindOfClass:[NSNumber class]]) {
3348
_startTrackingOnInitialize = [(NSNumber *)startTrackingOnInitializeObj boolValue];
3449
}
3550

3651
NSObject *trackOnceOnAppOpenObj = dict[@"trackOnceOnAppOpen"];
37-
_trackOnceOnAppOpen = NO;
3852
if (trackOnceOnAppOpenObj && [trackOnceOnAppOpenObj isKindOfClass:[NSNumber class]]) {
3953
_trackOnceOnAppOpen = [(NSNumber *)trackOnceOnAppOpenObj boolValue];
4054
}
4155

4256
NSObject *usePersistenceObj = dict[@"usePersistence"];
43-
_usePersistence = NO;
4457
if (usePersistenceObj && [usePersistenceObj isKindOfClass:[NSNumber class]]) {
4558
_usePersistence = [(NSNumber *)usePersistenceObj boolValue];
4659
}
4760

4861
NSObject *extendFlushReplaysObj = dict[@"extendFlushReplays"];
49-
_extendFlushReplays = NO;
5062
if (extendFlushReplaysObj && [extendFlushReplaysObj isKindOfClass:[NSNumber class]]) {
5163
_extendFlushReplays = [(NSNumber *)extendFlushReplaysObj boolValue];
5264
}
5365

5466
NSObject *useLogPersistenceObj = dict[@"useLogPersistence"];
55-
_useLogPersistence = NO;
5667
if (useLogPersistenceObj && [useLogPersistenceObj isKindOfClass:[NSNumber class]]) {
5768
_useLogPersistence = [(NSNumber *)useLogPersistenceObj boolValue];
5869
}
5970

6071
NSObject *useRadarModifiedBeaconObj = dict[@"useRadarModifiedBeacon"];
61-
_useRadarModifiedBeacon = NO;
6272
if (useRadarModifiedBeaconObj && [useRadarModifiedBeaconObj isKindOfClass:[NSNumber class]]) {
6373
_useRadarModifiedBeacon = [(NSNumber *)useRadarModifiedBeaconObj boolValue];
6474
}
6575

6676
NSObject *useLocationMetadataObj = dict[@"useLocationMetadata"];
67-
_useLocationMetadata = NO;
6877
if (useLocationMetadataObj && [useLocationMetadataObj isKindOfClass:[NSNumber class]]) {
6978
_useLocationMetadata = [(NSNumber *)useLocationMetadataObj boolValue];
7079
}
7180

7281
NSObject *useOpenedAppConversionObj = dict[@"useOpenedAppConversion"];
73-
_useOpenedAppConversion = NO;
7482
if (useOpenedAppConversionObj && [useOpenedAppConversionObj isKindOfClass:[NSNumber class]]) {
7583
_useOpenedAppConversion = [(NSNumber *)useOpenedAppConversionObj boolValue];
7684
}
7785

7886
NSObject *useForegroundLocationUpdatedAtMsDiffObj = dict[@"foregroundLocationUseUpdatedAtMsDiff"];
79-
_useForegroundLocationUpdatedAtMsDiff = NO;
8087
if (useForegroundLocationUpdatedAtMsDiffObj && [useForegroundLocationUpdatedAtMsDiffObj isKindOfClass:[NSNumber class]]) {
8188
_useForegroundLocationUpdatedAtMsDiff = [(NSNumber *)useForegroundLocationUpdatedAtMsDiffObj boolValue];
8289
}
8390

8491
NSObject *useNotificationDiffObj = dict[@"useNotificationDiff"];
85-
_useNotificationDiff = NO;
8692
if (useNotificationDiffObj && [useNotificationDiffObj isKindOfClass:[NSNumber class]]) {
8793
_useNotificationDiff = [(NSNumber *)useNotificationDiffObj boolValue];
8894
}

RadarSDK/RadarUtils.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ + (NSNumber *)timeZoneOffset {
4545
}
4646

4747
+ (NSString *)sdkVersion {
48-
return @"3.21.4";
48+
return @"3.21.5";
4949
}
5050

5151
+ (NSString *)deviceId {

RadarSDKMotion.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'RadarSDKMotion'
3-
s.version = '3.21.4'
3+
s.version = '3.21.5'
44
s.summary = 'Motion detection plugin for RadarSDK, the leading geofencing and location tracking platform'
55
s.homepage = 'https://radar.com'
66
s.author = { 'Radar Labs, Inc.' => '[email protected]' }

RadarSDKMotion/RadarSDKMotion.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@
289289
GCC_WARN_UNUSED_VARIABLE = YES;
290290
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
291291
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
292-
MARKETING_VERSION = 3.21.4;
292+
MARKETING_VERSION = 3.21.5;
293293
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
294294
MTL_FAST_MATH = YES;
295295
ONLY_ACTIVE_ARCH = YES;
@@ -348,7 +348,7 @@
348348
GCC_WARN_UNUSED_VARIABLE = YES;
349349
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
350350
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
351-
MARKETING_VERSION = 3.21.4;
351+
MARKETING_VERSION = 3.21.5;
352352
MTL_ENABLE_DEBUG_INFO = NO;
353353
MTL_FAST_MATH = YES;
354354
SDKROOT = iphoneos;

0 commit comments

Comments
 (0)