View
 

iPhone: Display a contact

Page history last edited by Becky 1 year ago

FYI - these Contact examples are for 0.9.3 and before.   Please see http://docs.phonegap.com/phonegap_contacts_contacts.md.html for 0.9.4 and beyond.

 

var __editDisplayFirstContact = false;

function displayFirstContact(allowsEditing) {

    __editDisplayFirstContact = allowsEditing;

    navigator.contacts.getAllContacts(displayFirstContact_Return, null, { "pageSize": 1, "pageNumber": 1});

}

function displayFirstContact_Return(contactsArray) { 

    for (var i = 0; i < contactsArray.length; i++) {

        navigator.contacts.displayContact(contactsArray[i].recordID, null, { "allowsEditing": __editDisplayFirstContact });

    }

}