React Native撥打電話

2021-07-22 10:05:41 字數 329 閱讀 8774

呼叫系統撥打**功能,其實和開啟瀏覽器訪問**是一樣的,只不過開啟的位址不是http或https開頭,而是tel:開頭,像這樣:

import  from 'react-native';

function callme()

但需要注意,有部分裝置是不支援撥打**的,這包括我們開發環境的ios模擬器,也包含某些平板或者安卓電視之類的裝置。這種情況下openurl會返回乙個失敗的promise(還記得什麼是promise嗎?),你也可以提前通過linking.canopenurl來判斷裝置是否支援,來給予使用者相應的提示。

iOS撥打電話

1,這種方法,撥打完 回不到原來的應用,會停留在通訊錄裡,而且是直接撥打,不彈出提示 nsmutablestring str nsmutablestring alloc initwithformat tel 186 x6979 nslog str str 2,這種方法,打完 後還會回到原來的程式,也...

iOS 撥打電話

1.這種方法,撥打完 回不到原來的應用,會停留在通訊錄裡,而且是直接撥打,不彈出提示 nsmutablestring str nsmutablestring alloc initwithformat tel 186 x6979 2.這種方法,打完 後還會回到原來的程式,也會彈出提示,推薦這種 nsm...

android 撥打電話

引用 1.不用許可權 intent intent new intent intent.action dial uri data uri.parse tel 135 xx intent.setdata data startactivity intent 2.需要許可權 intent intent ne...