Skip to content

Commit 4a5d0bd

Browse files
thib92facebook-github-bot
authored andcommitted
Resolve Promise to YES for Linking.openURL (#24955)
Summary: The `Linking.openURL()` method is supposed to resolve to a `true` `Promise` when the URL was properly open. However, in iOS, the `Promise` was resolving to `nil`. So I fixed this issue by making it resolve to `YES` (`true`), just like on Android. ## Changelog [iOS] [Fixed] - Fix return value of `Linking.openURL()` Pull Request resolved: #24955 Differential Revision: D15411994 Pulled By: cpojer fbshipit-source-id: 90bdd6cfae8d69d7a239a0b4c84d75859e293b32
1 parent 14b4668 commit 4a5d0bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Libraries/LinkingIOS/RCTLinkingManager.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ - (void)handleOpenURLNotification:(NSNotification *)notification
9595
if (@available(iOS 10.0, *)) {
9696
[RCTSharedApplication() openURL:URL options:@{} completionHandler:^(BOOL success) {
9797
if (success) {
98-
resolve(nil);
98+
resolve(@YES);
9999
} else {
100100
reject(RCTErrorUnspecified, [NSString stringWithFormat:@"Unable to open URL: %@", URL], nil);
101101
}
102102
}];
103103
} else {
104104
BOOL opened = [RCTSharedApplication() openURL:URL];
105105
if (opened) {
106-
resolve(nil);
106+
resolve(@YES);
107107
} else {
108108
reject(RCTErrorUnspecified, [NSString stringWithFormat:@"Unable to open URL: %@", URL], nil);
109109
}

0 commit comments

Comments
 (0)