reactnativecn / react-native-website

React Native 中文网
https://reactnative.cn
MIT License
218 stars 328 forks source link

react native版本为0.66.4,不能通过Linking.openURL()拨打电话 #534

Closed zhangshengmao closed 2 years ago

zhangshengmao commented 2 years ago

function (phone: string) { phone = tel:188888888; Linking.canOpenURL(phone) .then(supported => { if (!supported) { console.log("Can't handle url: " + phone); } else { return Linking.openURL(phone); } }) .catch(err => console.error('An error occurred', err)); } 升级到最新版本之后android不能拨打电话

react native版本为0.66.4, 猜测是因为sdk升级从29到了30 ext { buildToolsVersion = "30.0.2" minSdkVersion = 21 compileSdkVersion = 30 targetSdkVersion = 30 ndkVersion = "21.4.7075529" }

预期结果

能够拨打电话,打开短信编辑

qilovehua commented 2 years ago

0.66.4 我这试了ios/android可以拨打

buildToolsVersion = "30.0.2" minSdkVersion = 23 compileSdkVersion = 31 targetSdkVersion = 31

sixstones-sys commented 2 years ago

谢谢,我试了用这个方法可以解决 openURL Linking.openURL(tel:${this.corp_info?.contact_mobile}).then(supported => { if (!supported) { // 手机不支持 } return Linking.openURL(this.corp_info?.contact_mobile || ''); }).catch(err => { Toast.info('错误:' + err) })

github-actions[bot] commented 2 years ago

👋 Hey there, it looks like there has been no activity on this issue in the last 90 days. Has the issue been fixed, or does it still require the community attention? This issue will be closed in the next 7 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 2 years ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.