Skip to content

Commit

Permalink
SDK config
Browse files Browse the repository at this point in the history
  • Loading branch information
lmeier committed Dec 20, 2024
1 parent 406d523 commit 7b3fdad
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion RadarSDK/RadarAPIClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ - (void)trackWithLocation:(CLLocation *_Nonnull)location
}];
}

if (YES) {
if (sdkConfiguration.useNotificationDiff) {
// TODO: think through how this handles two successive trackOnce calls
[RadarNotificationHelper getNotificationDiffWithCompletionHandler:^(NSArray *notificationsDelivered, NSArray *notificationsRemaining) {
if (notificationsDelivered) {
Expand Down
2 changes: 2 additions & 0 deletions RadarSDK/RadarSdkConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ NS_ASSUME_NONNULL_BEGIN

@property (nonatomic, assign) BOOL useForegroundLocationUpdatedAtMsDiff;

@property (nonatomic, assign) BOOL useNotificationDiff;

/**
Initializes a new RadarSdkConfiguration object with given value.
*/
Expand Down
8 changes: 8 additions & 0 deletions RadarSDK/RadarSdkConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ - (instancetype)initWithDict:(NSDictionary *)dict {
_useForegroundLocationUpdatedAtMsDiff = [(NSNumber *)useForegroundLocationUpdatedAtMsDiffObj boolValue];
}

NSObject *useNotificationDiffObj = dict[@"useNotificationDiff"];
// TODO: make this default NO
_useNotificationDiff = YES;
if (useNotificationDiffObj && [useNotificationDiffObj isKindOfClass:[NSNumber class]]) {
_useNotificationDiff = [(NSNumber *)useNotificationDiffObj boolValue];
}

return self;
}

Expand All @@ -97,6 +104,7 @@ - (NSDictionary *)dictionaryValue {
dict[@"useLocationMetadata"] = @(_useLocationMetadata);
dict[@"useOpenedAppConversion"] = @(_useOpenedAppConversion);
dict[@"useForegroundLocationUpdatedAtMsDiff"] = @(_useForegroundLocationUpdatedAtMsDiff);
dict[@"useNotificationDiff"] = @(_useNotificationDiff);

return dict;
}
Expand Down

0 comments on commit 7b3fdad

Please sign in to comment.