Henrik
Henrik

Reputation: 4034

How to correctly add permissions for reading / writing to CNContactStore

I have an app that reads and writes to CNContactStore on Apple platforms. To facilitate this, I have added the App Sandbox/App Data/Contacts capability. It works, but this error is logged from the API when running on macOS (despite never requesting the CNContactNoteKey):

Attempt to read notes by an unentitled app

Can the log message be safely ignored, or is it necessary add the com.apple.developer.contacts.notes entitlement? According to this post, you have to opt out of automatic signing to make the entitlement work.

Upvotes: 0

Views: 89

Answers (1)

benc
benc

Reputation: 2051

If you do not crash, I would not worry about it, just keep in mind that the Contacts framework will not show you the data in the notes field.

If you are providing a user Contacts access as consumer/read-only client, I think Notes entitlement is largely unnecessary.

If you are going to be doing a contact editing or management, you should seriously consider it... (for example, what if your app deleted a contact for a user... but the contact had valuable information in notes?)

NOTE: I'm thinking about writing an app like this but I have not tried requesting the entitlement yet... I also haven't tested the use case I described above.

Upvotes: 0

Related Questions