jona jürgen
jona jürgen

Reputation: 1839

ABRecordGetRecordID returns -1

I am trying to get the ABRecordID of a record, but it always returns -1. Here is my code:

 NSNumber *recordId = [NSNumber numberWithInteger:ABRecordGetRecordID(person)];

I can retrieve other informations without any problems :/ Any solutions?

Upvotes: 3

Views: 985

Answers (1)

djromero
djromero

Reputation: 19641

You need to request authorization (ABAddressBookRequestAccessWithCompletion) to be able to get a record identifier. Otherwise you just get an ABPersonRef with a copy of the data.

Upvotes: 5

Related Questions