question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Linking.openURL behavior is not consistent with documentation

See original GitHub issue

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Steps to Reproduce

(Write your steps here:)

  1. Click button that calls Linking.openURL
  2. Wait for Confirm/Cancel popup
  3. 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:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

1reaction
treemorecommented, May 21, 2018

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 .

1reaction
react-native-botcommented, Feb 24, 2018

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 ContributeWhat to Expect from Maintainers

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found