I am trying to open a url ( "tel:061245124" or "mailto:[email protected]") and it says that i can handle url, also tried without the tel: or mail to but it crashes with a red screen. Urls like "http://test.com" work. What am I doing wrong?
handlePress(url) {
console.tron.log('Trying to access url')
console.tron.log(url)
Linking.canOpenURL(url).then(supported => {
if (!supported) {
console.tron.log('Can\'t handle url: ' + url)
} else {
return Linking.openURL(url)
}
}).catch(err => console.error('An error occurred', err))
}
The code works perfectly the problem was the iOS simulator, it needs to be tested on a device.