I’m just trying to initiate a phone call. I’ve checked the linking in the documentation. I initially started with this just to get some reaction and it sends back an unhandled promise rejection warning.
_handleCall = () => {
var str = this.state.event.evalPhone;
var phoneString = str.replace(/-/g, "");
console.log(phoneString);
Linking.openURL(`tel:${phoneString}`);
}
After some searching around I updated it to this but this doesn’t even return anything since it is handling the error.
_handleCall = () => {
var str = this.state.event.evalPhone;
var phoneString = str.replace(/-/g, "");
console.log(phoneString);
const url = `tel:${phoneString}`;
Linking.canOpenURL(url)
.then((supported) => {
if (supported) {
return Linking.openURL(url)
.catch(() => null);
}
});
}
How can I just test to see that it’s working? Should I just publish it and test it there? I apologize if this is something dumb I’m missing.