Skip to content

Commit c73989b

Browse files
committed
SDK-1704 : Added checks for earlier versions of iOS as well.
1 parent 44249a5 commit c73989b

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

Branch-SDK/BranchEvent.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#import "BNCReachability.h"
1313
#import "BNCSKAdNetwork.h"
1414
#import "BNCPartnerParameters.h"
15+
#import "BNCPreferenceHelper.h"
1516

1617
#pragma mark BranchStandardEvents
1718

@@ -83,7 +84,8 @@ - (void)processResponse:(BNCServerResponse*)response error:(NSError*)error {
8384

8485
if (dictionary && [dictionary[BRANCH_RESPONSE_KEY_UPDATE_CONVERSION_VALUE] isKindOfClass:NSNumber.class]) {
8586
NSNumber *conversionValue = (NSNumber *)dictionary[BRANCH_RESPONSE_KEY_UPDATE_CONVERSION_VALUE];
86-
if (conversionValue) {
87+
// Regardless of SKAN opted-in in dashboard, we always get conversionValue, so adding check to find out if install/open response had "invoke_register_app" true
88+
if (conversionValue && [BNCPreferenceHelper sharedInstance].invokeRegisterApp) {
8789
if (@available(iOS 16.1, *)){
8890
NSString * coarseConversionValue = [[BNCSKAdNetwork sharedInstance] getCoarseConversionValueFromDataResponse:dictionary] ;
8991
BOOL lockWin = [[BNCSKAdNetwork sharedInstance] getLockedStatusFromDataResponse:dictionary];

Branch-SDK/BranchOpenRequest.m

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,21 @@ - (void)processResponse:(BNCServerResponse *)response error:(NSError *)error {
313313
BNCLogDebug([NSString stringWithFormat:@"Update conversion value was successful for INSTALL Event"]);
314314
}
315315
}];
316-
} else {
316+
} else if (@available(iOS 15.4, *)){
317+
callCalback = NO;
318+
[[BNCSKAdNetwork sharedInstance] updatePostbackConversionValue:0 completionHandler:^(NSError * _Nullable error) {
319+
if(self.callback){
320+
self.callback(YES, error);
321+
}
322+
323+
if (error) {
324+
BNCLogError([NSString stringWithFormat:@"Update conversion value failed with error - %@", [error description]]);
325+
} else {
326+
BNCLogDebug([NSString stringWithFormat:@"Update conversion value was successful for INSTALL Event"]);
327+
}
328+
}];
329+
}
330+
else {
317331
[[BNCSKAdNetwork sharedInstance] registerAppForAdNetworkAttribution];
318332
}
319333
}
@@ -324,7 +338,8 @@ - (void)processResponse:(BNCServerResponse *)response error:(NSError *)error {
324338

325339
if (data && [data[BRANCH_RESPONSE_KEY_UPDATE_CONVERSION_VALUE] isKindOfClass:NSNumber.class] && !self.isInstall) {
326340
NSNumber *conversionValue = (NSNumber *)data[BRANCH_RESPONSE_KEY_UPDATE_CONVERSION_VALUE];
327-
if (conversionValue) {
341+
// Regardless of SKAN opted-in in dashboard, we always get conversionValue, so adding check to find out if install/open response had "invoke_register_app" true
342+
if (conversionValue && preferenceHelper.invokeRegisterApp ) {
328343
if (@available(iOS 16.1, *)){
329344
NSString* coarseConversionValue = [[BNCSKAdNetwork sharedInstance] getCoarseConversionValueFromDataResponse:data] ;
330345
BOOL lockWin = [[BNCSKAdNetwork sharedInstance] getLockedStatusFromDataResponse:data];

0 commit comments

Comments
 (0)