Skip to content

Commit 65dcd12

Browse files
committed
SDK-1741 Fix iOS 15.4 callback handling when SKAN is enabled.
1 parent 7ab60c1 commit 65dcd12

File tree

16 files changed

+26
-27
lines changed

16 files changed

+26
-27
lines changed

Branch-SDK/BNCConfig.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
NSString * const BNC_API_BASE_URL = @"https://api2.branch.io";
1212
NSString * const BNC_API_VERSION = @"v1";
1313
NSString * const BNC_LINK_URL = @"https://bnc.lt";
14-
NSString * const BNC_SDK_VERSION = @"1.45.1";
14+
NSString * const BNC_SDK_VERSION = @"1.45.2";

Branch-SDK/Branch.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) {
970970
971971
@param action The action string.
972972
*/
973-
- (void)userCompletedAction:(nullable NSString *)action;
973+
- (void)userCompletedAction:(nullable NSString *)action __attribute__((deprecated(("Please use BranchEvent to track commerce events. You can refer to https://help.branch.io/developers-hub/docs/tracking-commerce-content-lifecycle-and-custom-events for additional information."))));
974974

975975
/**
976976
Send a user action to the server with additional state items. Some examples actions could be things like `viewed_personal_welcome`, `purchased_an_item`, etc.
@@ -982,7 +982,7 @@ typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) {
982982
@param action The action string.
983983
@param state The additional state items associated with the action.
984984
*/
985-
- (void)userCompletedAction:(nullable NSString *)action withState:(nullable NSDictionary *)state;
985+
- (void)userCompletedAction:(nullable NSString *)action withState:(nullable NSDictionary *)state __attribute__((deprecated(("Please use BranchEvent to track commerce events. You can refer to https://help.branch.io/developers-hub/docs/tracking-commerce-content-lifecycle-and-custom-events for additional information."))));
986986

987987
/**
988988
Send a user action to the server with additional state items. Some examples actions could be things like `viewed_personal_welcome`, `purchased_an_item`, etc.
@@ -997,7 +997,7 @@ typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) {
997997
998998
@deprecated Please use userCompletedAction:action:state instead
999999
*/
1000-
- (void)userCompletedAction:(nullable NSString *)action withState:(nullable NSDictionary *)state withDelegate:(nullable id)branchViewCallback __attribute__((deprecated(("This API is deprecated. Please use userCompletedAction:action:state instead."))));
1000+
- (void)userCompletedAction:(nullable NSString *)action withState:(nullable NSDictionary *)state withDelegate:(nullable id)branchViewCallback __attribute__((deprecated(("Please use BranchEvent to track commerce events. You can refer to https://help.branch.io/developers-hub/docs/tracking-commerce-content-lifecycle-and-custom-events for additional information."))));
10011001

10021002
/**
10031003
Sends a user commerce event to the server.
@@ -1019,7 +1019,7 @@ typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) {
10191019
*/
10201020
- (void) sendCommerceEvent:(BNCCommerceEvent*)commerceEvent
10211021
metadata:(NSDictionary<NSString*,id>*)metadata
1022-
withCompletion:(void (^) (NSDictionary* _Nullable response, NSError* _Nullable error))completion __attribute__((deprecated(("Please use BranchEvent to track commerce events."))));
1022+
withCompletion:(void (^) (NSDictionary* _Nullable response, NSError* _Nullable error))completion __attribute__((deprecated(("Please use BranchEvent to track commerce events. You can refer to https://help.branch.io/developers-hub/docs/tracking-commerce-content-lifecycle-and-custom-events for additional information."))));
10231023

10241024

10251025
#pragma mark - Query methods

Branch-SDK/Branch.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,9 @@ - (void)userCompletedAction:(NSString *)action {
11341134
}
11351135

11361136
- (void)userCompletedAction:(NSString *)action withState:(NSDictionary *)state {
1137+
1138+
NSLog(@"'userCompletedAction' method has been deprecated. Please use BranchEvent for your event tracking use cases. You can refer to https://help.branch.io/developers-hub/docs/tracking-commerce-content-lifecycle-and-custom-events for additional information.");
1139+
11371140
if (!action) {
11381141
return;
11391142
}
@@ -1164,6 +1167,7 @@ - (void)sendServerRequestWithoutSession:(BNCServerRequest*)request {
11641167
}
11651168

11661169
- (void)sendCommerceEvent:(BNCCommerceEvent *)commerceEvent metadata:(NSDictionary*)metadata withCompletion:(void (^)(NSDictionary *, NSError *))completion {
1170+
NSLog(@"'sendCommerceEvent' method has been deprecated. Please use BranchEvent for your event tracking use cases. You can refer to https://help.branch.io/developers-hub/docs/tracking-commerce-content-lifecycle-and-custom-events for additional information.");
11671171
[self initSafetyCheck];
11681172
dispatch_async(self.isolationQueue, ^(){
11691173
BranchCommerceEventRequest *request = [[BranchCommerceEventRequest alloc] initWithCommerceEvent:commerceEvent metadata:metadata completion:completion];

Branch-SDK/BranchEvent.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ - (void)processResponse:(BNCServerResponse*)response error:(NSError*)error {
9898
} else {
9999
BNCLogDebug([NSString stringWithFormat:@"Update conversion value was successful. Conversion Value - %@", conversionValue]);
100100
}
101-
return;
102101
}];
103102
}
104103

@@ -109,9 +108,7 @@ - (void)processResponse:(BNCServerResponse*)response error:(NSError*)error {
109108
} else {
110109
BNCLogDebug([NSString stringWithFormat:@"Update conversion value was successful. Conversion Value - %@", conversionValue]);
111110
}
112-
return;
113111
}];
114-
return;
115112
} else {
116113
[[BNCSKAdNetwork sharedInstance] updateConversionValue:conversionValue.integerValue];
117114
}

Branch-SDK/BranchOpenRequest.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ - (void)processResponse:(BNCServerResponse *)response error:(NSError *)error {
336336

337337
if(shouldCallUpdatePostback){
338338
[[BNCSKAdNetwork sharedInstance] updatePostbackConversionValue: conversionValue.longValue coarseValue:coarseConversionValue lockWindow:lockWin completionHandler:^(NSError * _Nullable error) {
339-
340339
if (error) {
341340
BNCLogError([NSString stringWithFormat:@"Update conversion value failed with error - %@", [error description]]);
342341
} else {
@@ -346,15 +345,12 @@ - (void)processResponse:(BNCServerResponse *)response error:(NSError *)error {
346345
}
347346
} else if (@available(iOS 15.4, *)) {
348347
[[BNCSKAdNetwork sharedInstance] updatePostbackConversionValue:conversionValue.intValue completionHandler: ^(NSError *error){
349-
350348
if (error) {
351349
BNCLogError([NSString stringWithFormat:@"Update conversion value failed with error - %@", [error description]]);
352350
} else {
353351
BNCLogDebug([NSString stringWithFormat:@"Update conversion value was successful. Conversion Value - %@", conversionValue]);
354352
}
355-
return;
356353
}];
357-
return;
358354
} else {
359355
[[BNCSKAdNetwork sharedInstance] updateConversionValue:conversionValue.integerValue];
360356
}

Branch-TestBed/Branch-TestBed.xcodeproj/Branch-TestBed.xctestplan

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
"resolvedPath" : "..\/Simulate-FirstRun.xcappdata"
3131
},
3232
"skippedTests" : [
33-
"BNCAppleAdClientTests",
34-
"BNCAppleSearchAdsTests"
33+
"BNCServerInterfaceTests"
3534
],
3635
"target" : {
3736
"containerPath" : "container:Branch-TestBed.xcodeproj",
0 Bytes
Binary file not shown.

Branch-TestBed/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ SPEC CHECKSUMS:
2929

3030
PODFILE CHECKSUM: 829cf437db3e2065c6c17ddea2f24b51cb0aecc0
3131

32-
COCOAPODS: 1.11.2
32+
COCOAPODS: 1.11.3

Branch.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 = "Branch"
3-
s.version = "1.45.1"
3+
s.version = "1.45.2"
44
s.summary = "Create an HTTP URL for any piece of content in your app"
55
s.description = <<-DESC
66
- Want the highest possible conversions on your sharing feature?

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Branch iOS SDK Change Log
22

3+
v.1.45.2
4+
- SDK-1741 Fix SKAN error handling on iOS 15.4
5+
36
v.1.45.1
47
- SDK-1724 Branch SDK returns an error "SKANErrorDomain Code=10" in initSession function - Fix
58

0 commit comments

Comments
 (0)