Skip to content

Commit cdc9440

Browse files
committed
add userCompletedAction to BUO
1 parent 03b8efa commit cdc9440

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

Branch-SDK/Branch-SDK/Branch.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ extern NSString * const BRANCH_INIT_KEY_PHONE_NUMBER;
103103
extern NSString * const BRANCH_INIT_KEY_IS_FIRST_SESSION;
104104
extern NSString * const BRANCH_INIT_KEY_CLICKED_BRANCH_LINK;
105105

106+
extern NSString * const BNCCanonicalIdList;
107+
extern NSString * const BNCPurchaseAmount;
108+
106109
#pragma mark - Branch Enums
107110
typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) {
108111
BranchMostRecentFirst,

Branch-SDK/Branch-SDK/Branch.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
NSString * const BRANCH_INIT_KEY_CLICKED_BRANCH_LINK = @"+clicked_branch_link";
5757
NSString * const BRANCH_PUSH_NOTIFICATION_PAYLOAD_KEY = @"branch";
5858

59+
NSString * const BNCCanonicalIdList = @"$canonical_identifier_list";
60+
NSString * const BNCPurchaseAmount = @"$amount";
61+
5962
@interface Branch() <BranchDeepLinkingControllerCompletionDelegate, FABKit>
6063

6164

@@ -538,6 +541,7 @@ - (void)userCompletedAction:(NSString *)action {
538541
}
539542

540543
- (void)userCompletedAction:(NSString *)action withState:(NSDictionary *)state {
544+
NSLog(@"action: %@, state: %@", action, state);
541545
[self userCompletedAction:action withState:state withDelegate:nil];
542546
}
543547

Branch-SDK/Branch-SDK/BranchUniversalObject.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ typedef NS_ENUM(NSInteger, ContentIndexMode) {
4242
- (void)registerView;
4343
- (void)registerViewWithCallback:(callbackWithParams)callback;
4444

45+
46+
- (void)userCompletedAction:(NSString *)action;
47+
4548
- (NSString *)getShortUrlWithLinkProperties:(BranchLinkProperties *)linkProperties;
4649
- (NSString *)getShortUrlWithLinkPropertiesAndIgnoreFirstClick:(BranchLinkProperties *)linkProperties;
4750
- (void)getShortUrlWithLinkProperties:(BranchLinkProperties *)linkProperties andCallback:(callbackWithUrl)callback;

Branch-SDK/Branch-SDK/BranchUniversalObject.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ - (void)registerViewWithCallback:(callbackWithParams)callback {
7474
[[Branch getInstance] registerViewWithParams:[self getParamsForServerRequest] andCallback:callback];
7575
}
7676

77+
- (void)userCompletedAction:(NSString *)action {
78+
NSMutableDictionary *actionPayload = [[NSMutableDictionary alloc] init];
79+
NSDictionary *linkParams = [self getParamsForServerRequest];
80+
actionPayload[BNCCanonicalIdList] = @[self.canonicalIdentifier];
81+
actionPayload[self.canonicalIdentifier] = linkParams;
82+
83+
// to be removed: this will not work if they are using getTestInstance. Thoughts?
84+
[[Branch getInstance] userCompletedAction:action withState:actionPayload];
85+
}
86+
7787
#pragma mark - Link Creation Methods
7888

7989
- (NSString *)getShortUrlWithLinkProperties:(BranchLinkProperties *)linkProperties {

0 commit comments

Comments
 (0)