目录

Telephony

has.makePhoneCall

has.makePhoneCall(Object object)

Makes a phone call.

Since: 1.0.0

Parameters

The input parameter is an object containing the following fields.

Parameter Type Mandatory Description
phoneNumber string Yes Phone number.
success function No Callback triggered when the API call is successful.
fail function No Callback triggered when the API call fails.
complete function No Callback triggered when the API call is complete, regardless of success or failure.

Error code information

Error Code Error Message
101 context is undefined.
12000201

1. cancel: makePhoneCall is not support on current device.

2. confirm: makePhoneCall is not support on current device.

3. makePhoneCall is not support on current device and UIContext is null.

12000301

1. makePhoneCall failed.

2. makePhoneCall error.

Example:

has.makePhoneCall({
  phoneNumber: '138********',
  success: () => {
    console.info('makePhoneCall success');
  },
  fail: (err) => {
    console.error('makePhoneCall fail', err);
  },
  complete: (res) => {
    console.info('makePhoneCall complete', res);
  }
});