chooseContactMethod

This method allows the user to choose a contact from the native device's contacts application

intel.xdk.contacts.chooseContact();

Description:

This method displays the native device's contacts application to allow the user to choose from the list. Once a contact is chosen, it will fire the intel.xdk.contacts.choose event.

Available Platforms:

Events:

  • intel.xdk.contacts.choose: This event is fired once a contact has been selected or the operation is cancelled. On success, it returns the contact ID of the contact chosen.
  • intel.xdk.contacts.busy: This event will fire if the contacts.chooseContact method is called while another process is blocking access to the device's contacts.

Example:


document.addEventListener('intel.xdk.contacts.choose', onChooseContact);

intel.xdk.contacts.chooseContact();

function onChooseContact(evt) {
   if (evt.success == true)
   {
      intel.xdk.contacts.editContact(evt.contactid);
   }
   else if (evt.cancelled == true)
   {
      alert("Choose Contact Cancelled");
   }
            
Einzelheiten zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.