showContacts crashes on device only?
I'm using the latest continuous builds to add a contacts picker to iPhone. Using the documentation & this [lighthoust ticket][ticket] I have it working in the simulator, but it is crashing on the device no matter what contact I choose. Any ideas?
btnContacts.addEventListener('click', function(e) {
var values = {
cancel: function () { },
animated: true,
selectedPerson: function (e) {
var email = '';
var phone = '';
if (e.person.email != undefined) {
var emailTypes = ['home', 'work', 'other'];
for (var emailIndex = 0, emailLen = emailTypes.length; emailIndex < emailLen; emailIndex++) {
if (e.person.email[emailTypes[emailIndex]] != undefined && e.person.email[emailTypes[emailIndex]].length > 0) {
email = e.person.email[emailTypes[emailIndex]][0];
break;
}
}
}
tfFirstName.value = isEmptyStr(e.person.firstName) ? '' : e.person.firstName;
tfLastName.value = isEmptyStr(e.person.lastName) ? '' : e.person.lastName;
tfEmail.value = isEmptyStr(email) ? '' : email;
}
};
Titanium.Contacts.showContacts(values);
[ticket] : https://appcelerator.lighthouseapp.com/projects/32238/tickets/1001
2 Answers
-
Has this been fixed? Is there a publicly accessible workaround?
-
Still having this issue, latest continuous build, even without custom labels. Please advise, I cannot use the contacts being as I have the issue with getAllPeople() as well.
Also, wrapping the code in a try catch doesn't stop the app from crashing on the device.