Steps to reproduce
1. Create titanium classic app
2. Use this sample code
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
var btn3 = Ti.UI.createButton({
title: 'show Contacts',
top:'15%'
});
btn3.addEventListener('click', function(e){
Ti.Contacts.showContacts({
cancel: function(e) {
alert('cancelled');
},
selectedPerson: function(e) {
var person = e.person;
Ti.API.info(person);
alert('person selected is ' + person.fullName);
},
// selectedProperty: function(e) {
// alert('property selected\n' + e.property +'\n' + e.label +'\n'+e.value);
// Ti.API.info(e.value);
// Ti.API.info(e.person.fullName);
// Ti.API.info(e.property);
// Ti.API.info(e.value);
// Ti.API.info(e.label);
// }
});
});
win.add(btn3);
win.open();
3. Show Contacts
4. Select a person
Expected Result
alert dialog with person's name shown
Actual Result
alert dialog with 'no name' shown
PR https://github.com/appcelerator/titanium_mobile/pull/7585 Use the test case provided in the ticket. In iOS 8 presenting contact picker don't need User permission anymore. But in this case we cannot query meta data like recordId. This was not handled when updated to iOS 8 API. So is this issue. Note that person.recordId will be -1 when contacts permission is not granted by User. But once permission is granted, person.recordId will return expected value. https://developer.apple.com/library/ios/releasenotes/General/RN-iOSSDK-8.0/
CR and FT approved. Thats Srikanth!
Can verify this ticket as fixed. Tested with the following environment; iPhone 7 (10.2) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.3 GA Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80