I have a contact with linked contacts. So when I show this contact with ABPersonViewController is has original emails and emails from linked contacts.
When I select linked email (John-appleseed@mac.com) then delegate method calls:
- (BOOL)personViewController:(ABPersonViewController *)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
{
//get selected phone number
ABMultiValueRef multi = ABRecordCopyValue(person, property);
CFIndex index = ABMultiValueGetIndexForIdentifier(multi, identifier);
NSString *selectedContactData = (__bridge_transfer NSString *)ABMultiValueCopyValueAtIndex(multi, index);
return NO;
}
But in selectedContactData I get not selected email, but first one. I have this problem only with combined contacts.
Is there a proper way to choose email from contact with connected contacts?