Skip to content

Commit

Permalink
fix(dynamic-links, ios): remove double-reject on resolveLink
Browse files Browse the repository at this point in the history
the iOS firebase-ios-sdk handleUniversalLink completion handler
correctly handles all of the error conditions by resolving or rejecting
the passed in react-native promise as needed, but was incorrectly
then testing success status and rejecting again on unfound links

e2e tests were already probing this case to verify correct behavior
at the javascript level but the native-level double-reject went
unnoticed until now
  • Loading branch information
mikehardy committed Feb 13, 2021
1 parent e78a329 commit 395a723
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,7 @@ - (id)init {
}
};

NSURL *linkURL = [NSURL URLWithString:link];
BOOL success = [[FIRDynamicLinks dynamicLinks] handleUniversalLink:linkURL completion:completion];
if (!success) {
[RNFBSharedUtils rejectPromiseWithUserInfo:reject userInfo:(NSMutableDictionary *) @{
@"code": @"not-found",
@"message": @"Dynamic link not found"
}];
}
[[FIRDynamicLinks dynamicLinks] handleUniversalLink:[NSURL URLWithString:link] completion:completion];
}

- (FIRDynamicLinkComponents *)createDynamicLinkComponents:(NSDictionary *)dynamicLinkDict {
Expand Down

1 comment on commit 395a723

@vercel
Copy link

@vercel vercel bot commented on 395a723 Feb 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.