Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14243] Android: Ti.Contacts not reflecting complete information from system contacts

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-07-29T21:51:19.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.4.0
ComponentsAndroid
Labelsmodule_android, qe-closed-3.4.0, qe-manualtest, qe-testadded
ReporterAlexander Frischbutter
AssigneeHieu Pham
Created2013-06-08T01:30:19.000+0000
Updated2014-10-29T21:58:38.000+0000

Description

Hi, to reproduce the bug, first create a contact and add "organization", "url (www)" and some name etc. Important ist the organization and url run this code in an app.js
 
// open a single window
var win = Ti.UI.createWindow({
	backgroundColor:'white'
});
var label = Ti.UI.createLabel();
win.add(label);
win.open();

alert("running");

var singleValue = [
  'recordId', 'firstName', 'middleName', 'lastName', 'fullName', 'prefix', 'suffix', 
  'nickname', 'firstPhonetic', 'middlePhonetic', 'lastPhonetic', 'organization', 
  'jobTitle', 'department', 'note', 'birthday', 'created', 'modified', 'kind'
];
var multiValue = [
  'email', 'address', 'phone', 'instantMessage', 'relatedNames', 'date', 'url'
];
var people = Ti.Contacts.getAllPeople();
Ti.API.info('Total contacts: ' + people.length);
for (var i=0, ilen=people.length; i<ilen; i++){
  Ti.API.info('---------------------');
  var person = people[i];
  for (var j=0, jlen=singleValue.length; j<jlen; j++){
    Ti.API.info(singleValue[j] + ': ' + person[singleValue[j]]);
  }
  for (var j=0, jlen=multiValue.length; j<jlen; j++){
    Ti.API.info(multiValue[j] + ': ' + JSON.stringify(person[multiValue[j]]));
  }
}
Response you get looks like this:
 
06-08 03:25:05.075: I/TiAPI(1336):  ---------------------
06-08 03:25:05.075: I/TiAPI(1336):  recordId: undefined
06-08 03:25:05.075: I/TiAPI(1336):  firstName: undefined
06-08 03:25:05.075: I/TiAPI(1336):  middleName: undefined
06-08 03:25:05.075: I/TiAPI(1336):  lastName: undefined
06-08 03:25:05.085: I/TiAPI(1336):  fullName: Bester Tester
06-08 03:25:05.085: I/TiAPI(1336):  prefix: undefined
06-08 03:25:05.085: I/TiAPI(1336):  suffix: undefined
06-08 03:25:05.085: I/TiAPI(1336):  nickname: undefined
06-08 03:25:05.085: I/TiAPI(1336):  firstPhonetic: undefined
06-08 03:25:05.085: I/TiAPI(1336):  middlePhonetic: undefined
06-08 03:25:05.085: I/TiAPI(1336):  lastPhonetic: undefined
06-08 03:25:05.085: I/TiAPI(1336):  organization: undefined
06-08 03:25:05.085: I/TiAPI(1336):  jobTitle: undefined
06-08 03:25:05.085: I/TiAPI(1336):  department: undefined
06-08 03:25:05.085: I/TiAPI(1336):  note: null
06-08 03:25:05.085: I/TiAPI(1336):  birthday: null
06-08 03:25:05.085: I/TiAPI(1336):  created: undefined
06-08 03:25:05.085: I/TiAPI(1336):  modified: undefined
06-08 03:25:05.085: I/TiAPI(1336):  kind: 1
06-08 03:25:05.105: I/TiAPI(1336):  email: {}
06-08 03:25:05.105: I/TiAPI(1336):  address: {}
06-08 03:25:05.115: I/TiAPI(1336):  phone: {"mobile":["1 125-478"]}
06-08 03:25:05.115: I/TiAPI(1336):  instantMessage: undefined
06-08 03:25:05.115: I/TiAPI(1336):  relatedNames: undefined
06-08 03:25:05.115: I/TiAPI(1336):  date: undefined
06-08 03:25:05.115: I/TiAPI(1336):  url: undefined
Even bigger problem ist, you dont get the first and lastname, but if you try to create a contact only with fullname, you get a contact without a name. Please fix it soon. 3.2.0.v20130522185622 But the same result on earlier builds

Attachments

FileDateSize
Bildschirmfoto 2013-06-13 um 15.13.28.png2013-06-13T13:28:12.000+000029786
Bildschirmfoto 2013-06-13 um 15.21.31.png2013-06-13T13:28:12.000+000024149
Bildschirmfoto 2013-06-13 um 15.23.08.png2013-06-13T13:28:12.000+000029965
Log_timob14243.txt2014-08-20T08:47:29.000+00001638

Comments

  1. Carter Lathrop 2013-06-12

    Hello Alexander, Thanks for bringing this to our attention. I have successfully reproduced the issue you are seeing. For testing purposes though can you please provide all the values for the contact entries that you have posted in the contact so that we can more clearly see what parts are working vs what is not. For example, if you enter a first and last name I noticed that the full name will show (the first and last name together) but the individual values (firstName & lastName) do not show. For completeness sake, including the values that should be there but aren't would be helpful to determine exactly what needs fixing. Thanks again for your help with this. Regards, Carter
  2. Alexander Frischbutter 2013-06-13

    Here is my new Test: Some data like birthday I coundn't set, but it migth be possible on other android systems [INFO][TiAPI ( 1544)] Total contacts: 1 [INFO][TiAPI ( 1544)] --------------------- [INFO][TiAPI ( 1544)] recordId: undefined [INFO][TiAPI ( 1544)] firstName: {color:red} undefined{color} [INFO][TiAPI ( 1544)] middleName:{color:red} undefined{color} [INFO][TiAPI ( 1544)] lastName: {color:red} undefined{color} [INFO][TiAPI ( 1544)] fullName: Pre Alexander Mi Tester, Su [INFO][TiAPI ( 1544)] prefix: {color:red} undefined{color} [INFO][TiAPI ( 1544)] suffix: {color:red} undefined{color} [INFO][TiAPI ( 1544)] nickname: undefined [INFO][TiAPI ( 1544)] firstPhonetic: undefined [INFO][TiAPI ( 1544)] middlePhonetic: undefined [INFO][TiAPI ( 1544)] lastPhonetic: undefined [INFO][TiAPI ( 1544)] organization: {color:red} undefined{color} [INFO][TiAPI ( 1544)] jobTitle: {color:red} undefined{color} [INFO][TiAPI ( 1544)] department: undefined [INFO][TiAPI ( 1544)] note: Ggggggv note [INFO][TiAPI ( 1544)] birthday: null [INFO][TiAPI ( 1544)] created: undefined [INFO][TiAPI ( 1544)] modified: undefined [INFO][TiAPI ( 1544)] kind: 1 [INFO][TiAPI ( 1544)] email: {} [INFO][TiAPI ( 1544)] address: {"home":[{"Street":"Test Streeet"}]} [INFO][TiAPI ( 1544)] phone: {"home":["1 111-111-222"],"mobile":["1 111-111-111"]} [INFO][TiAPI ( 1544)] instantMessage: undefined [INFO][TiAPI ( 1544)] relatedNames: undefined [INFO][TiAPI ( 1544)] date: undefined [INFO][TiAPI ( 1544)] url: {color:red} undefined{color}
  3. Alexander Frischbutter 2013-06-13

    Seems like email is missing to
  4. Alexander Frischbutter 2013-06-24

    Additional problem, the phone > home [INFO][TiAPI ( 1544)] phone: {"home":["1 111-111-222"],"mobile":["1 111-111-111"]} If you try to create a contact and pass an object with a "home" number, the number will be not added to the contact, but it works fine with "mobile"
  5. Alexander Frischbutter 2013-09-22

    Does it will be fixed? It's one of the key features and it does not work...
  6. Biju pm 2014-04-02

    PR :- https://github.com/appcelerator/titanium_mobile/pull/5571
  7. Sunila 2014-07-21

    New PR uploaded https://github.com/appcelerator/titanium_mobile/pull/5923
  8. Dhirendra Jha 2014-08-20

    Environment - Appc Studio - 3.4.0.201408180158 SDK - 3.4.0.v20140819094113 acs - 1.0.16 alloy - 1.5.0-dev npm - 1.3.2 titanium - 3.4.0-dev titanium-code-processor - 1.1.1 OS - mavericks (v10.9.4) Xcode - 6Beta5 Device - Nexus5(v4.4.4) Result - Now its working fine, shows the contact informations in console. See the attached log file for details. hence closing this issue.

JSON Source