Home > DeveloperSection > Forums > How to get person id using ABAddressBook in iOS
Tom Cruser
Tom Cruser

Total Post:28

Points:196
Posted on    December-02-2015 7:05 AM

 iPhone iPhone  Ios  Objective C 
Ratings:


 1 Reply(s)
 347  View(s)
Rate this:
I have successfully fetched all the contacts with the help of ABAddressBook in our application.
But now my need is to get unique identify of each contact person.
I am using ABRecordGetRecordID, but I am doing somthing wrong.

So, anyone who have my problems solution, then please reply me.
thanks in advance!


Steven Hill
Steven Hill

Total Post:10

Points:72
Supported
Posted on    December-08-2015 12:04 AM

To get each person Id I am using code like this:

ABRecordRef contactPerson = (__bridge ABRecordRef)allContacts[i];
NSNumber *contactId = [NSNumber numberWithInt: ABRecordGetRecordID(contactPerson)];

In this code I am fetching ID into NSNumber format, you can use another format.


Don't want to miss updates? Please click the below button!

Follow MindStick