joshuapinter / react-native-unified-contacts

Your best friend when working with the latest and greatest Contacts Framework in iOS 9+ in React Native.
MIT License
158 stars 56 forks source link

Removed usage of CNContactNoteKey #94

Closed brascene closed 4 years ago

brascene commented 4 years ago

Hi there, while fetching contacts I've encountered error on iOS 13 related with com.apple.developer.contacts.notes, and I've just removed the usage of CNContactNoteKey and removed one line of code using it, and fetching contacts works again. So this is just small PR for that :) And of course thanks for this lib!!

Fixes #95.

joshuapinter commented 4 years ago

Thanks @brascene! Will review later.

danneu2s1fa commented 4 years ago

The above fix worked for me as well, thanks. In case anyone is searching for this fix, the error message from Contacts.getContacts on failure is:

"The operation couldn’t be completed. (CNErrorDomain error 102.)"

According to the following post this is due to a privacy change in iOS 13:

https://stackoverflow.com/questions/57442114/ios-13-cncontacts-no-longer-working-to-retrieve-all-contacts

brascene commented 4 years ago

@joshuapinter Did you find time to review this, and can you merge it pls? I'm about to ship an app using this lib :)

joshuapinter commented 4 years ago

Hey @brascene. I'd suggest pointing to your branch of the library in your package.json for now. That won't prevent you from shipping your app.

A breaking change like this will require a major release, unless we can figure out a way to keep the notes field with some changes to permissions, etc.

joshuapinter commented 4 years ago

This has been merged into master and released to npm as v2.0.0-pre.2. Update your package.json accordingly or use master branch.

NOTE: You will no longer be able to access the note attribute of a Contact so update your app if you're doing that.