All Products
Document Center


Last Updated: Feb 19, 2021


This interface is used to select the phone number of a contact from the local directory.


Parameter Type Required Description
success Function No Callback function upon call success.
fail Function No Callback function upon call failure.
complete Function No Callback function upon call completion (to be executed upon either call success or failure).

Return value on success

Name Type Description
name String Selected contact name.
mobile String Selected phone number of the contact.

Error code

error Description Solution
10 No permission. Check the permission.
11 The user cancels the operation (or the device hasn’t been authorized to use the directory). It is recommended to authorize the device for using directoy.

Sample code

  1. my.choosePhoneContact({
  2. success: (res) => {
  3. my.alert({
  4. content: 'Name:' + + '\nPhone number:' +
  5. });
  6. },
  7. });