Project: titanium
Issue TIMOB-20118: iOS9: Contacts property fullName does not return appropriate values
h5. Description: Created a test contact with values given to all properties, when logging {{fullName}} to the console, it does not display the associated variables in the correct order, and {{middleName}} is replaced by {{organisation}}: *Note: This issue only occurs for iOS9, and fullName property returns the correct variables when built to an iOS8 device/ sim.* {code:java} [INFO] : firstName: Nathan [INFO] : middleName: John [INFO] : lastName: Cook [INFO] : fullName: Mr III Appcelerator Nathan Cook [INFO] : prefix: Mr [INFO] : suffix: III {code} h5. Steps to reproduce: 1. Create a classic project. 2. Include following demo code: {code:java} var win1 = Titanium.UI.createWindow({ title:'Tab 1', backgroundColor:'#fff' }); var Nathan =""; Ti.Contacts.requestAuthorization(function(e) { if (e.success == true) { alert('Contact Request Authorization success'); } else { alert('Contact Request Authorization denied'); } }); var createContact = Ti.UI.createButton({ title: "Create New Contact", }); createContact.addEventListener('click',function(e){ if (Nathan != null) { Nathan = Ti.Contacts.createPerson({ firstName: 'Nathan', lastName: 'Cook', middleName: 'John', nickname: 'Fish', prefix: 'Mr', suffix: 'III', firstPhonetic: 'N', middlePhonetic: 'T', lastPhonetic: 'A', organization: 'appcelerator', department: 'Cloud', jobTitle: 'QE', note: 'You gotta risk it, to get the biscuit', kind: Ti.Contacts.CONTACTS_KIND_PERSON, address:{ work:[ { CountryCode: 'GB', // determines how the address is displayed Street: '123 Wales Road', City: 'Camarthan', Country: 'Wales', PostalCode: 'CA35 9TW' }, { CountryCode: 'US', // determines how the address is displayed Street: '321 America Road', City: 'San Jose', State: 'CA', Country: 'The United States of America', PostalCode: '84009' } ], home:[ { CountryCode: 'gb', // determines how the address is displayed Street: '2 Boleyn Court', City: 'London', State: 'Greenwich', Country: 'England', PostalCode: 'SE10' } ] }, email:{ home : [ 'myGmail', 'myHotmail' ], work : [ 'myWorkemail' ] }, relatedNames:{ father: ['Big Daddy','Big Daddy Sr'], mother: ['Big Momma', 'Big Momma Sr'], child: ['Derek'] }, birthday: '2012-01-01T12:00:00.000+0000', instantMessage:{ home:[ { service: 'AIM', username: 'leisureAIM' }, { service: 'MSN', username: 'no_paul_here@msn.com' } ], work:[ { service: 'AIM', username: 'seriousAIM' } ] }, organization: 'Appcelerator', phone:{ main: ['07900 000001', '07900 000002'], iPhone: ['+44 (0)118 925 6128', '+44 (0)118 000 0000'] }, alternateBirthday: { calendarIdentifier: 'chinese', day: 25, era: 78, isLeapMonth: false, month: 11, year: 16 }, socialProfile:{ home:[{ service: 'facebook', username: 'jdeep@facebook.com' }, { service: 'gamecenter', username: 'jdeep@hotmail.com' }], work:[{ service: 'linkedin', username: 'jdeep@linkedin.com' }] }, url:{ homepage: ['www.google.com'], work: ['www.appcelerator.com', 'www.example.com'] }, date:{ anniversary: ['2006-06-25T12:00:00.000+0000','2007-06-25T12:00:00.000+0000'], other: ['2009-03-25T12:00:00.000+0000'] } }); } else { return; } }); var button = Ti.UI.createButton({ title: 'Select Contact', height: '50dp', width: '130dp', top: '20%' }); button.addEventListener('click', function(e) { Ti.Contacts.showContacts({ selectedProperty: function(e){ alert(JSON.stringify(e)); } }); }); button.addEventListener("click", function(e) { var singleValue = [ 'firstName', 'middleName', 'lastName', 'fullName', 'prefix', 'suffix', 'nickname', 'firstPhonetic', 'middlePhonetic', 'lastPhonetic', 'organization', 'jobTitle', 'department', 'note', 'birthday', 'kind' ]; var multiValue = [ 'email', 'address', 'phone', 'instantMessage', 'relatedNames', 'date', 'url' ]; var people = Ti.Contacts.getPeopleWithName("Nathan"); Ti.API.info('Total contacts: ' + people.length); for (var i=0, ilen=people[0]; i<1; i++){ Ti.API.info('---------------------'); var person = people[i]; for (var j=0, jlen=singleValue.length; j
Story points: 3