How would I store information in a CNContact object that the contact store would keep as persistent data in iOS?

Viewed 49

I need to be able to identify a CNContact so as to associate it with a CKRecord in a iCloud private database.

If I use a non-unified contact, would the identifier be unique across all existing iOS devices so that I could store the identifier property in a record in the user's iCloud private database to identify a specific contact? The documentation says that the identifier of a CNContact stored object is unique within the device.

If I use a UUID value and store it in the iCloud private database to identify the specific contact, how would I match that with the contact? I would need to save that UUID value as part of the contact object as stored in the contact store. Is that possible without saving the UUID value in the notes property of the contact. It would be better if I could store the UUID value somewhere where the user could not access it and delete or edit it. Is there a way to make the notes property of a contact inaccessible to the user where even if he/she could see it, he would not be able to change it?

Though unlikely, would I be able to use the hash or hashValue of the NSContact object to uniquely identify it across all existing iOS devices so I could store the value of that property in a record in iCloud in order to associate that record with that contact?

0 Answers
Related