I'm tryna get the contacts list of the device but react-native-contacts returns undefined.

I've Installed the package and linked it as mentioned in the project's GitHub page https://github.com/rt2zz/react-native-contacts
I've also added the permissions to the android-manifest file. How do I get it works
This happens mostly because of the linking-step was missing as there are native modules required:
After npm install react-native-contacts (or yarn add) you are required to link the stuff with
react-native link react-native-contacts
Afterwards you need to rebuild your project (react-native run-android or build in Android Studio). Just to "Reload" in Simulator or on Device is not sufficient after linking a native library.
Also some more permissions needs to be placed in AndroidManifest.xml:
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With