Skip to content

Commit 70d0b02

Browse files
committed
Anticipate that the native SDK may eventually support userCompletedAction:withState:
1 parent 03fa03a commit 70d0b02

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

ios/BranchUniversalObject+RNBranch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616

1717
- (instancetype)initWithMap:(NSDictionary *)map;
1818

19-
- (void)userCompletedAction:(NSString *)action withState:(NSDictionary *)state;
19+
- (void)rnbranchUserCompletedAction:(NSString *)action withState:(NSDictionary *)state;
2020

2121
@end

ios/BranchUniversalObject+RNBranch.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,15 @@ - (void)setExpirationDateWithString:(NSString *)expirationDate
101101
* Until the native SDK supports this, the following is largely lifted from BUO.m.
102102
*/
103103

104-
- (void)userCompletedAction:(NSString *)action withState:(NSDictionary *)state
104+
- (void)rnbranchUserCompletedAction:(NSString *)action withState:(NSDictionary *)state
105105
{
106+
// Anticipate that the native SDK will support this.
107+
SEL sdkMethod = @selector(userCompletedAction:withState:);
108+
if ([self respondsToSelector:sdkMethod]) {
109+
[self performSelector:sdkMethod withObject:action withObject:state];
110+
return;
111+
}
112+
106113
NSMutableDictionary *actionPayload = [[NSMutableDictionary alloc] init];
107114
NSDictionary *linkParams = [self getParamsForServerRequest];
108115
if (self.canonicalIdentifier && linkParams) {

ios/RNBranch.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ - (BranchUniversalObject *)findUniversalObjectWithIdent:(NSString *)ident reject
221221
BranchUniversalObject *branchUniversalObject = [self findUniversalObjectWithIdent:identifier rejecter:reject];
222222
if (!branchUniversalObject) return;
223223

224-
[branchUniversalObject userCompletedAction:event withState:state];
224+
[branchUniversalObject rnbranchUserCompletedAction:event withState:state];
225225
resolve(NSNull.null);
226226
}
227227

0 commit comments

Comments
 (0)