(buttonIndex) => { switch (buttonIndex) { case 0: Communications.phonecall(phone, true); break; case 1: Communications.text(phone); break; } });
export function callPhone(phoneNumber: string, opts?: Options) { const {prompt = true} = opts || {} try { phonecall(phoneNumber, prompt) } catch (err) { Alert.alert( "Apologies, we couldn't call that number", `We were trying to call "${phoneNumber}".`, [ { text: 'Darn', onPress: () => {}, }, { text: 'Copy number', onPress: () => Clipboard.setString(phoneNumber), }, ], ) } }
call() { const tel = this.props.student.telephone.replace(/-/g, '') Communications.phonecall(tel, true) }
<TouchableOpacity onPress={() => Communications.phonecall('0123456789', true)}>
const onPress = () => { phonecall(p.number, false); };
<TouchableOpacity style={{height:40}} onPress={() => Communications.phonecall('180017001600', true)}>
<Button onPress={() => Communications.phonecall(`${currentPet.contact_phone}`, true)}>
{text: 'OK', onPress: () => Communications.phonecall(this.props.navigation.state.params.DienThoai, true)},
_call:function(){ Communications.phonecall('4008288686',true); },
<TouchableOpacity onPress={() => Communications.phonecall(this.props.personInfo.cell, true)}>
_onHotlineButton(){ Communications.phonecall('2134584288', true) }
<TouchableHighlight onPress={() => Communications.phonecall('022117734000', true)}>
<TouchableHighlight onPress={() => Communications.phonecall('911', true)} style={styles.buttonbottom}>