Initiate a phone call from your mini program using the my.makePhoneCall API.
my.makePhoneCall(OBJECT)
Note
This interface is only supported in mPaaS 10.1.32 and later versions.
Initiates the system phone dialer with a specified number.
Parameters
|
Parameter |
Type |
Required |
Description |
|
number |
String |
Yes |
Phone number |
Sample code
// API-DEMO page/API/make-phone-call/make-phone-call.json
{
"defaultTitle": "Make phone call"
}<!-- API-DEMO page/API/make-phone-call/make-phone-call.axml-->
<view class="page">
<view class="page-section">
<view class="page-section-title">my.makePhoneCall</view>
<view class="page-section-btns">
<view onTap="makePhoneCall">Make phone call</view>
</view>
</view>
</view>// API-DEMO page/API/make-phone-call/make-phone-call.js
Page({
makePhoneCall() {
my.makePhoneCall({ number: '95888' });
},
});
该文章对您有帮助吗?