All Products
Search
Document Center

Mobile Platform as a Service:Contact

Last Updated:Feb 19, 2021

my.choosePhoneContact

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

Parameters

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:' + res.name + '\nPhone number:' + res.mobile
  5. });
  6. },
  7. });