Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20147] iOS: Ti.Contacts.showContacts() selectedPerson returns empty on iOS 8.4

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-12-23T01:40:42.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelscontacts
ReporterAngel Petkov
AssigneeSrikanth Sombhatla
Created2015-12-15T04:15:06.000+0000
Updated2017-03-23T21:04:44.000+0000

Description

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

Comments

  1. Srikanth Sombhatla 2015-12-16

    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/
  2. Angel Petkov 2015-12-23

    CR and FT approved. Thats Srikanth!
  3. Lee Morris 2017-03-23

    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

JSON Source