let url = 'tel: ' + this.state.ConsigneePhone;
Linking.canOpenURL(url).then(supported => {
if (!supported) {
console.log('Can\'t handle url: ' + url);
} else {
return Linking.openURL(url);
}
}).catch(err => console.error('An error occurred', err));
上面这段代码中ConsigneePhone是在state中的电话号码,Linking是react native的组件用openURL可以打开电话功能

相关文章:

  • 2021-12-16
  • 2022-12-23
  • 2021-08-11
  • 2021-10-11
  • 2021-08-16
  • 2022-12-23
  • 2021-11-10
  • 2022-02-07
猜你喜欢
  • 2021-11-29
  • 2021-08-18
  • 2021-08-05
  • 2021-11-14
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
相关资源
相似解决方案