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.
Asked
Active
Viewed 328 times
1 Answers
0
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
x@gmail.com
x2@gmail.com
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.

Vizllx
- 9,135
- 1
- 41
- 79
-
Hi buddy , Can you elaborate please ? Are you saying some of the contacts that i fetched may have same recordId and i have to traverse all in order to merge their details(phones,emails)? Also What if two different contacts happened to have same first and last name ?,they should not have same recordId and i should not merge them in to a single contact right? – Kalai_Human Jan 29 '16 at 11:03
-
Well, if two different contacts have same name, they will have different recordid. – Vizllx Jan 29 '16 at 11:05
-
Regarding this--- "Are you saying some of the contacts that i fetched may have same recordId and i have to traverse all in order to merge their details(phones,emails)?" ---- Yes, you just have to group all as per record id, so that you can make single contact for all the numbers and emails related to that contact. Is it clear to you? – Vizllx Jan 29 '16 at 11:08