I'm facing a serious issue while fetching contacts from the contacts list using PhoneGap. I have installed the plugin and did everything but seems it doesn't work for me.
So, What is the problem ? The problem with it is my contacts having the email accounts.So email doesn't have the phonenumber. Here is the screenshot : http://prntscr.com/82meyr
What is the issue ?
Well, the problem is that when it encounters the email the for loop stops immediately and shows the 20-30 contacts only!
function onSuccess(contacts)
{
alert("Total contacts = "+ contacts.length);
for (var i=0; i<contacts.length; i++)
{
$('#contactList').append("<li><a href='#'><h2>"+ contacts[i].displayName +"</h2><p>" + contacts[i].phoneNumbers[0].value + "</p></a></li>");
$('#contactList').listview("refresh");
}
}
My contacts .vcf file. You can import it on your emulator.
Link : https://dl.dropboxusercontent.com/u/43274075/00004.vcf
Here is the code I'm using.(already posted but didn't get answer)
--> https://stackoverflow.com/questions/31889859/phonegap-error-on-the-physical-device
Is there any way to bypass the email accounts ?
Thank you!
来源:https://stackoverflow.com/questions/31905615/phonegap-retrieve-contacts