android使用uni.makePhoneCall
https://uniapp.dcloud.net.cn/api/system/phone.html
uni.makePhoneCall({
phoneNumber: '114' //僅為示例
});
Android需要在 manifest.json 增加權(quán)限
<uses-permission android:name="android.permission.CALL_PHONE"/>
其他
包括微信和真機(jī)撥打電話兩種方式
//#ifdef MP-WEIXIN
uni.makePhoneCall({
phoneNumber: '18354789632'
});
//#endif
//#ifdef APP-PLUS
plus.device.dial('18354789632', true);
//#endif
注:plus.device.dial的第2個(gè)參數(shù)是是否跳到手機(jī)撥號(hào)頁面,true是跳過去讓用戶自己點(diǎn)呼叫按鈕,false是不跳過去直接打這個(gè)號(hào)碼文章來源:http://www.zghlxwxcb.cn/news/detail-735894.html
android真機(jī)撥打電話需要增加權(quán)限,權(quán)限如下:文章來源地址http://www.zghlxwxcb.cn/news/detail-735894.html
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
到了這里,關(guān)于UNI-APP_uni.makePhoneCall實(shí)現(xiàn)撥打電話功能(android)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!