Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
try {
const phoneHash = getPhoneHash(e164Number)
yield put(transferEscrowedPayment(phoneHash, amount, temporaryAddress))
} catch (e) {
Logger.error(TAG, 'Error sending payment to unverified user: ', e)
yield put(showError(ErrorMessages.TRANSACTION_FAILED))
}
}
switch (inviteMode) {
case InviteBy.SMS: {
yield call(sendSms, e164Number, msg)
break
}
case InviteBy.WhatsApp: {
yield Linking.openURL(`https://wa.me/${e164Number}?text=${encodeURIComponent(msg)}`)
break
}
}
// Wait a little bit so it has time to switch to Sms/WhatsApp before updating the UI
yield delay(100)
} catch (e) {
Logger.error(TAG, 'Send invite error: ', e)
throw e
}
}
Linking.canOpenURL(url).then(supported => {
if (!supported) {
console.log('Can\'t handle url: ' + url);
} else {
return Linking.openURL(url);
}
}).catch(err => {
console.error('Error on link press ', err)
onPress={() => Linking.openURL(photoUrl)}
>
open (url) {
Linking.openURL(url)
}
return new Promise((resolve, reject) => {
if (authToken) {
if (openInSafari) {
Linking.openURL(url)
.then(() => resolve({ event: "success", url }))
.catch(() => reject());
} else {
Browser.openBrowserAsync(url)
.then(() => {
resolve({ event: "closing", url });
})
.catch(() => reject());
}
} else {
reject();
}
});
}
Linking.canOpenURL(url).then(supported => {
if (!supported) {
Toast.fail("此链接打不开");
} else {
return Linking.openURL(url);
}
}).catch(err => Toast.fail("An error occurred:" + url));
};
onPress={() => Linking.openURL(publicTransport.url)}
underlayColor="#f0f0f0"
onPress={() => Linking.openURL(currentStation.get('website'))}
>
handleSlackUrl = () => {
if (this.props.slackUrl) {
Linking.openURL(this.props.slackUrl);
}
};
render() {