Skip to content

Commit

Permalink
Anticipate that the native SDK may eventually support userCompletedAc…
Browse files Browse the repository at this point in the history
…tion:withState:
  • Loading branch information
jdee committed Mar 14, 2017
1 parent 03fa03a commit 70d0b02
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ios/BranchUniversalObject+RNBranch.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@

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

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

@end
9 changes: 8 additions & 1 deletion ios/BranchUniversalObject+RNBranch.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,15 @@ - (void)setExpirationDateWithString:(NSString *)expirationDate
* Until the native SDK supports this, the following is largely lifted from BUO.m.
*/

- (void)userCompletedAction:(NSString *)action withState:(NSDictionary *)state
- (void)rnbranchUserCompletedAction:(NSString *)action withState:(NSDictionary *)state
{
// Anticipate that the native SDK will support this.
SEL sdkMethod = @selector(userCompletedAction:withState:);
if ([self respondsToSelector:sdkMethod]) {
[self performSelector:sdkMethod withObject:action withObject:state];
return;
}

NSMutableDictionary *actionPayload = [[NSMutableDictionary alloc] init];
NSDictionary *linkParams = [self getParamsForServerRequest];
if (self.canonicalIdentifier && linkParams) {
Expand Down
2 changes: 1 addition & 1 deletion ios/RNBranch.m
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ - (BranchUniversalObject *)findUniversalObjectWithIdent:(NSString *)ident reject
BranchUniversalObject *branchUniversalObject = [self findUniversalObjectWithIdent:identifier rejecter:reject];
if (!branchUniversalObject) return;

[branchUniversalObject userCompletedAction:event withState:state];
[branchUniversalObject rnbranchUserCompletedAction:event withState:state];
resolve(NSNull.null);
}

Expand Down

0 comments on commit 70d0b02

Please sign in to comment.