Does pressing a phone number or email to open up their respective apps work? I tried LinkingIOS.openURL("mailto:[email protected]") but it doesn't work. It seems to only work with http URL's even though the LinkingIOS documentation says "To trigger an app link (browser, _email_ or custom schemas)"
Maybe it's a simulator problem?
Hi @coderdave - you are right, this won't work in the simulator but if you open it up on your device you should find that it will work exactly as expected. If not, feel free to ping me here and I can look into it further for you. It's worth noting that the openURL method under the hood is just: [[UIApplication sharedApplication] openURL:URL];, so there's not really any magic going on there :smile:
@coderdave - I also added some clarification to the docs, thanks for the heads up that this might lead to confusion! Commit: https://github.com/facebook/react-native/commit/ebdc041b4f6afac4e08e2abee9b0d787f651e752
@brendanv Great, thanks for the clarification!
@brentvatne I am trying to do the same thing
For Twitter:
Linking.openURL('https://twitter.com/appi2393') - it works (Opens the twitter app)
Linking.openURL('https://www.facebook.com/appi2393') - doesn't work it opens the facebook page in browser and not the app
Any help is appreciated ?
Hi @apurvajain - did you figure out why FB was opening in the browser instead of the app?
@vanessa-bell Try Linking.openURL('fb://profile?id=appi2392') - should work fine.
Thanks @apurvajain. I actually want to be able to post a status via the FB native app, but looks like that's not possible or recommended by Facebook.
Most helpful comment
Hi @coderdave - you are right, this won't work in the simulator but if you open it up on your device you should find that it will work exactly as expected. If not, feel free to ping me here and I can look into it further for you. It's worth noting that the
openURLmethod under the hood is just:[[UIApplication sharedApplication] openURL:URL];, so there's not really any magic going on there :smile: