PhoneGap retrieve contacts

依然范特西╮ 提交于 2019-12-02 09:16:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!