Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1146] Can't access phone numbers from Contacts app if synced with google

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionNeeds more info
Resolution Date2014-10-15T02:14:09.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsTCSupportTriage, android, defect
ReporterMarten Nelson
AssigneeShuo Liang
Created2014-07-18T23:29:53.000+0000
Updated2016-03-08T07:37:30.000+0000

Description

I'm retrieving Contacts using Ti.Contacts.getAllPeople and build a listview to select contacts from a pick list. If the Android Contacts app was synced with my google account (Android function) then none of the contact's phone numbers is accessible in the list items. If I synch the Contact app with LinkedIn, the phone numbers are accessible through the list items. Also, If I clear the Contacts app and enter contacts manually on the phone, the phone numbers are accessible from the list item. Seems like when syncing Contacts app with google, the data is stored differently, which makes it inaccessible for Ti.Contacts.getAllPeople.

Attachments

FileDateSize
contactList.js2014-08-05T18:21:42.000+00005044

Comments

  1. Shuo Liang 2014-07-31

    Hi, In my test, can't produce your problem. Ti.Contacts.getAllPeople works well even with synced google account. Maybe you can try retrieve the phone as a json data. Like this
       var people = Ti.Contacts.getAllPeople();
       for (var i=0, ilen=people.length; i<ilen; i++) {
                 var person = people[i];
                 Ti.API.info(JSON.stringify(person["phone"]));
       }
       
  2. Mauro Parra-Miranda 2014-08-05

    Hello! Did the JSON hint helped? Best Regards!
  3. Marten Nelson 2014-08-05

    I think that's sort of what we're doing. See attached code.
  4. Shuo Liang 2014-08-06

    Hi Marten, Would you please try that simple test case(first comment) in your environment, like create a new project, see whether it work or not. Regards, Shuo

JSON Source