Device APIs

makePhoneCall

Initiate a phone call to the given number.

Overview

my.makePhoneCall opens the device dialer and initiates a call to the specified phone number.

The Mini Program Studio simulator does not support this API. Use a real device to debug.

Sample Code

function makePhoneCall() {
  my.makePhoneCall({
    number: "00000",
  });
}

Parameters

PropertyTypeRequiredDescription
numberStringYesPhone number to call.
successFunctionNoCallback function upon call success.
failFunctionNoCallback function upon call failure.
completeFunctionNoCallback function upon call completion.

Usage Notes

  • The system dialer is used; the user can cancel or complete the call there.
  • Simulator may show an "is not a function" error; test on a real device.