1

In my iOS app, the user is able to select emails from the AddressBookUI via the ABPeoplePickerNavigationController. The problem is that one email for a contact entry comes from the address book and another email is from the Facebook sync. When the user taps on one of these emails in ABPeoplePickerNavigationController the delegate method will be called with the same parameters. I cannot get the right email that user has selected. In my case propertyID equals 4 and identifier 0.

- (BOOL)personViewController:(ABPersonViewController *)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifierForValue {

    ABMultiValueRef multiValue = ABRecordCopyValue(person, property);
    CFIndex index = ABMultiValueGetIndexForIdentifier(multiValue, identifierForValue);
    NSString *email = CFBridgingRelease(ABMultiValueCopyValueAtIndex(multiValue, index));
    CFRelease(multiValue);

    NSLog(@"Email: %@", email );

    return NO;
}

The result in each delegate method is the same. I have this problem only when there is a facebook email address which seems to have the same identifiers. With all the other contacts with multiple emails the parameters of the delegate method are correct. It would be nice if someone could help me with this problem. Thanks in advance.

AddisDev
  • 1,791
  • 21
  • 33

0 Answers0