Skip to content

Resolve Promise to YES for Linking.openURL#24955

Closed
thib92 wants to merge 1 commit intofacebook:masterfrom
thib92:patch-1
Closed

Resolve Promise to YES for Linking.openURL#24955
thib92 wants to merge 1 commit intofacebook:masterfrom
thib92:patch-1

Conversation

@thib92
Copy link
Copy Markdown
Contributor

@thib92 thib92 commented May 19, 2019

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()

Test Plan

Create a sample app, and use the Linking API to open a URL (I use Uber deeplinks: uber://, following
their deep-links docs). Make sure that the Promise resolves to true on the JS side.

With the code from the version I use for my project (0.59.1), I received undefined. With these changes, I received true on the JS side.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 19, 2019
@facebook-github-bot
Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Copy Markdown
Contributor

@cpojer cpojer left a comment

Choose a reason for hiding this comment

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

Thank you!

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @thib92 in 4a5d0bd.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label May 20, 2019
@thib92 thib92 deleted the patch-1 branch May 20, 2019 10:54
M-i-k-e-l pushed a commit to M-i-k-e-l/react-native that referenced this pull request Mar 10, 2020
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: facebook#24955

Differential Revision: D15411994

Pulled By: cpojer

fbshipit-source-id: 90bdd6cfae8d69d7a239a0b4c84d75859e293b32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API: Linking Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Platform: iOS iOS applications.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants