Plugin Contact show all name and phone numbers


#1

Hi , how can I extract from the address book, all the names and phone numbers?

Now i use this code :

var options    = new ContactFindOptions();
options.filter = "";
options.multiple = true;
options.desiredFields = [navigator.contacts.fieldType.id];
var fields = ["displayName", "name", "nickname", "emails", "phoneNumbers"];
navigator.contacts.find(fields, onSuccess, onError, options);

If i write in the function onSuccess “contacts.length” , i see the total number of contacts , but if i want see the name or the phone numbers , the result is “undefined” .

Can you help me ?