---
title: "How to get person id using ABAddressBook in iOS"  
description: "How to get person id using ABAddressBook in iOS"  
author: "Tom Cruser"  
published: 2015-12-02  
updated: 2015-12-08  
canonical: https://www.mindstick.com/forum/33673/how-to-get-person-id-using-abaddressbook-in-ios  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# How to get person id using ABAddressBook in iOS

I have successfully fetched all the [contacts](https://answers.mindstick.com/qa/50746/how-to-setup-your-contacts-on-your-iphone-7) with the help of **ABAddressBook** in our application.\
But [now](https://yourviews.mindstick.com/view/81402/it-s-liberals-vs-progressives-in-us-politics-now) my need is to get **[unique](https://www.mindstick.com/blog/12870/how-to-be-unique-in-business) [identify](https://www.mindstick.com/forum/159425/java-app-crash-arrayindexoutofboundsexception-identify-invalid-index)** of each **contact person.**\
I am using **ABRecordGetRecordID**, but I am doing somthing wrong.\
\
So, [anyone](https://www.mindstick.com/articles/23207/how-to-find-the-best-fit-job-for-anyone) who have my problems solution, then please reply me.\
thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!\

## Replies

### Reply by Anonymous User

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.


---

Original Source: https://www.mindstick.com/forum/33673/how-to-get-person-id-using-abaddressbook-in-ios

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
