反应本地-拨打带分机号的电话 [英] React native -- call phone number with extension

查看:102
本文介绍了反应本地-拨打带分机号的电话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试打开带分机号的电话号码.只需电话号码即可链接

I am trying to open phone number with extension. Linking works with just phone number

尝试很少的选择

Linking.openURL('tel:XXXXXXXXX,XXX');

Linking.openURL('tel:'+ encodeURIComponent('XXXXXXXXX,XXX'));

拨号器仅拨打主号码,不包括分机号

Dialer only dials primary number and doesnt include extension

我可以编写本机代码并公开该方法,但这将是我的最后选择

I could write a native code and expose the method, but that would be my last option

推荐答案

我知道已经很晚了,但是您可以尝试以下组件:

I know it is late, but you can try this component: react-native-communications.

它在iOS和Android上均可正常运行.

It works well both on iOS and Android.

您必须将其导入所需的文件中

You have to import it in the file you need:

import Communications from 'react-native-communications';

,然后根据需要使用它:

and then use it as you need:

<TouchableOpacity onPress={() => Communications.phonecall(phoneNumbers[0].number, true)}>

这篇关于反应本地-拨打带分机号的电话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆