Linking.openURL behavior is not consistent with documentation
See original GitHub issueIs this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Steps to Reproduce
(Write your steps here:)
- Click button that calls
Linking.openURL
- Wait for
Confirm/Cancel
popup - Press
Cancel
Expected Behavior
Expect: Linking.openURL
should reject
Actual Behavior
Actual: Linking.openURL
resolves
Reproducible Demo
Steps to recreate:
react-native init LinkTest
- In App.js render add;
<TouchableOpacity onPress={this.onPress}>
<Text>
Link
</Text>
</TouchableOpacity>
and in App class;
onPress = () => {
const link = 'tel:2125551212'
Linking.openURL(link)
.then(() => {
console.log('CONFIRM')
})
.catch(() => {
console.log('CANCEL')
})
}
No repo included due to this needing to be run on a device to test
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
React Native open Facebook page - Stack Overflow
Ok, found one way to open Facebook: Linking.openURL('fb://page/PAGE_ID'); Linking.openURL('http://instagram.com/_u/USER_NAME'); Linking.
Read more >Linking - React Native
Linking gives you a general interface to interact with both incoming and outgoing app links.
Read more >OpenURLAction | Apple Developer Documentation
The system provides a default open URL action with behavior that depends on the contents of the URL. For example, the default action...
Read more >Window.open() - Web APIs | MDN
open() open(url) open(url, target) open(url, target, windowFeatures) ... how to open such links (in a new window or not, in the same window, ......
Read more >Deep Linking for iOS - Braze
For more information, refer to Apple's documentation on the ... The default universal link integration is not compatible with Braze's push notifications, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i was test in react-native 0.55.3 and 0.55.4 . and i am sure Linking.openURL behavior is not consistent with documentation . whenever your choice confirm or cancel . the promise resolve will be done .
Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?
I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.
How to Contribute • What to Expect from Maintainers