Outgoing Links
suggest changeTo open a link call openURL.
Linking.openURL(url)
.catch(err => console.error('An error occurred ', err))
Prefer to check whether an installed app can handle a URL first. On iOS, canOpenURL returns false unless the scheme is listed in LSApplicationQueriesSchemes.
Linking.canOpenURL(url)
.then(supported => {
if (!supported) {
console.log('Unsupported URL: ' + url)
} else {
return Linking.openURL(url)
}
}).catch(err => console.error('An error occurred ', err))
URI Schemes
| Target app | Example | Reference |
|---|---|---|
| Web browser | https://stackoverflow.com |
|
| Phone | tel:1-408-555-5555 |
Apple |
mailto:email@example.com |
Apple | |
| SMS | sms:1-408-555-1212 |
Apple |
| Apple Maps | http://maps.apple.com/?ll=37.484847,-122.148386 |
Apple |
| Google Maps | geo:37.7749,-122.4194 |
|
| iTunes | See iTunes Link Maker | Apple |
fb://profile |
Stack Overflow | |
| YouTube | http://www.youtube.com/v/oHg5SJYRHA0 |
Apple |
| FaceTime | facetime://user@example.com |
Apple |
| iOS Calendar | calshow:514300000 [1] |
iPhoneDevWiki |
[1] Opens the calendar at that many seconds since 1 January 2001 (UTC). Apple does not document this API.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents