0
votes

When fetching all the contacts from Addressbook in order to show a custom contacts picker, some contacts are partial. i.e. Same contact may have been synced from facebook or iCloud. So there may be two contacts , one will contain email address and second one contain phone number of same person. How will i make this partially splitted contacts unified into one single contact when fetching all the contacts in addressbook.

1

1 Answers

0
votes

There is a property :- ABRecordID for getting a unique id for a contact.

For Example:- In your iPhone contacts, there is contact of Mr X like this:-

Mr X

+1 5667-8899

+91 77977 98789

[email protected]

[email protected]

So, to uniquely identify all emails or phone numbers belongs to Mr X, ABRecordID is there.

And as per your question whenever you try to fetch all the contacts, once that is done then group the contacts data as per the record id , that is how you will get single contact for multiple phone or emails.

Apple doc:- https://developer.apple.com/library/ios/documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/Chapters/DirectInteraction.html