How to migrate ABRecordRef to CNContact

tl;dr: How, if at all, do ABRecordRef <> CNContact.identifer relate?


Hey there, I have an app that used to use ABAddressBook, and would create my own internal copy of the contact that included the ABRecordRef. Then I listened for changes to the Address Book and would be able to update my internal copies by comparing ABRecordRef's.


After migrating to the CNContact framework, CNContact's have Identifiers, which were like ABRecordRefs, but they are not the same. Now, if the address book/contact store changes on the device (now listening via CNContactStoreDidChangeNotification), how can identify my legacy contacts?

Replies

I have a similar issue. My app lets users link from items in my database to their contacts. I stored the ABRecordId in my database to direct them back to that contact. Now that I'm using CNContact, I'm trying to use that old ABRecordId as the identifier in store.unifiedContact(withIdentifier:), but that doesn't find the contact. Is there a way to get the CNContact via the old ABRecordId?