How to get person id using ABAddressBook in iOS

Total Post:28

Points:196
 933  View(s)
Ratings:
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!
  1. Post:10

    Points:72
    Re: How to get person id using ABAddressBook in iOS

    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.

Answer