@@ -21,68 +21,74 @@ - (instancetype)initWithDict:(NSDictionary *)dict {
21
21
return nil ;
22
22
}
23
23
24
- NSObject *logLevelObj = dict[ @" logLevel " ];
24
+ // Set default values
25
25
_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" ];
26
42
if (logLevelObj && [logLevelObj isKindOfClass: [NSString class ]]) {
27
43
_logLevel = [RadarLog levelFromString: (NSString *)logLevelObj];
28
44
}
29
45
30
46
NSObject *startTrackingOnInitializeObj = dict[@" startTrackingOnInitialize" ];
31
- _startTrackingOnInitialize = NO ;
32
47
if (startTrackingOnInitializeObj && [startTrackingOnInitializeObj isKindOfClass: [NSNumber class ]]) {
33
48
_startTrackingOnInitialize = [(NSNumber *)startTrackingOnInitializeObj boolValue ];
34
49
}
35
50
36
51
NSObject *trackOnceOnAppOpenObj = dict[@" trackOnceOnAppOpen" ];
37
- _trackOnceOnAppOpen = NO ;
38
52
if (trackOnceOnAppOpenObj && [trackOnceOnAppOpenObj isKindOfClass: [NSNumber class ]]) {
39
53
_trackOnceOnAppOpen = [(NSNumber *)trackOnceOnAppOpenObj boolValue ];
40
54
}
41
55
42
56
NSObject *usePersistenceObj = dict[@" usePersistence" ];
43
- _usePersistence = NO ;
44
57
if (usePersistenceObj && [usePersistenceObj isKindOfClass: [NSNumber class ]]) {
45
58
_usePersistence = [(NSNumber *)usePersistenceObj boolValue ];
46
59
}
47
60
48
61
NSObject *extendFlushReplaysObj = dict[@" extendFlushReplays" ];
49
- _extendFlushReplays = NO ;
50
62
if (extendFlushReplaysObj && [extendFlushReplaysObj isKindOfClass: [NSNumber class ]]) {
51
63
_extendFlushReplays = [(NSNumber *)extendFlushReplaysObj boolValue ];
52
64
}
53
65
54
66
NSObject *useLogPersistenceObj = dict[@" useLogPersistence" ];
55
- _useLogPersistence = NO ;
56
67
if (useLogPersistenceObj && [useLogPersistenceObj isKindOfClass: [NSNumber class ]]) {
57
68
_useLogPersistence = [(NSNumber *)useLogPersistenceObj boolValue ];
58
69
}
59
70
60
71
NSObject *useRadarModifiedBeaconObj = dict[@" useRadarModifiedBeacon" ];
61
- _useRadarModifiedBeacon = NO ;
62
72
if (useRadarModifiedBeaconObj && [useRadarModifiedBeaconObj isKindOfClass: [NSNumber class ]]) {
63
73
_useRadarModifiedBeacon = [(NSNumber *)useRadarModifiedBeaconObj boolValue ];
64
74
}
65
75
66
76
NSObject *useLocationMetadataObj = dict[@" useLocationMetadata" ];
67
- _useLocationMetadata = NO ;
68
77
if (useLocationMetadataObj && [useLocationMetadataObj isKindOfClass: [NSNumber class ]]) {
69
78
_useLocationMetadata = [(NSNumber *)useLocationMetadataObj boolValue ];
70
79
}
71
80
72
81
NSObject *useOpenedAppConversionObj = dict[@" useOpenedAppConversion" ];
73
- _useOpenedAppConversion = NO ;
74
82
if (useOpenedAppConversionObj && [useOpenedAppConversionObj isKindOfClass: [NSNumber class ]]) {
75
83
_useOpenedAppConversion = [(NSNumber *)useOpenedAppConversionObj boolValue ];
76
84
}
77
85
78
86
NSObject *useForegroundLocationUpdatedAtMsDiffObj = dict[@" foregroundLocationUseUpdatedAtMsDiff" ];
79
- _useForegroundLocationUpdatedAtMsDiff = NO ;
80
87
if (useForegroundLocationUpdatedAtMsDiffObj && [useForegroundLocationUpdatedAtMsDiffObj isKindOfClass: [NSNumber class ]]) {
81
88
_useForegroundLocationUpdatedAtMsDiff = [(NSNumber *)useForegroundLocationUpdatedAtMsDiffObj boolValue ];
82
89
}
83
90
84
91
NSObject *useNotificationDiffObj = dict[@" useNotificationDiff" ];
85
- _useNotificationDiff = NO ;
86
92
if (useNotificationDiffObj && [useNotificationDiffObj isKindOfClass: [NSNumber class ]]) {
87
93
_useNotificationDiff = [(NSNumber *)useNotificationDiffObj boolValue ];
88
94
}
0 commit comments