React Native Contacts is a JavaScript library for React Native applications, providing cross-platform access to the device's contact list on both Android and iOS. The current stable version is 8.0.10. While not on a fixed release schedule, the library sees regular maintenance and bug fixes, with recent updates (like v8.0.0) focusing on compatibility with the new React Native architecture (TurboModules and Fabric). It also provides fixes for compatibility with older legacy bridge projects (v8.0.9, v8.0.10). Key differentiators include its long-standing support for both major mobile platforms, straightforward API for retrieving, adding, and updating contacts, and handling of native permissions. Users should be aware of performance considerations when using `getAll` and specific installation steps tailored for different React Native versions and architectures.
npm install react-native-contactsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to request Android runtime permissions for contacts and then fetch all contacts using `Contacts.getAll()`.
Remove `pod 'react-native-contacts'` from your `ios/Podfile` if it exists. Run `npx react-native unlink react-native-contacts` if previously linked, then `npm install react-native-contacts` and `cd ios && pod install`.
For React Native 0.60+ (and especially with new architecture enabled), ensure `pod 'react-native-contacts', :path => '../node_modules/react-native-contacts'` is present in your `ios/Podfile` and run `pod install`. For Android, ensure `android/settings.gradle` and `android/app/build.gradle` are correctly configured for autolinking or manual linking if below RN 0.60.
If using RN 0.60+, ensure your project has migrated to AndroidX. If using RN < 0.60, downgrade `react-native-contacts` to `4.x.x` (e.g., `npm install react-native-contacts@4`).
It is highly recommended to call `getAll()` before the data is critically needed and cache the results for subsequent uses. Consider implementing a loading state or background process for contact retrieval.
Add the `NSContactsUsageDescription` key and a user-facing message to your `Info.plist` file in Xcode.
Ensure `react-native-contacts` is properly linked for your React Native version and platform. For RN 0.60+, run `cd ios && pod install` after adding the pod line. For Android, verify `settings.gradle` and `app/build.gradle` configurations. Clean caches: `watchman watch-del-all && rm -rf node_modules && npm install && cd ios && pod install && cd .. && npm start -- --reset-cache`.
Migrate your React Native project to AndroidX if using RN 0.60+. If you must use RN < 0.60, downgrade `react-native-contacts` to a `4.x.x` version by running `npm install react-native-contacts@4`.
For React Native 0.60+, ensure `pod 'react-native-contacts', :path => '../node_modules/react-native-contacts'` is added to your `ios/Podfile` inside your target, then run `cd ios && pod install`. For older RN versions, verify manual linking steps (dragging `RCTContacts.xcodeproj` to `Libraries` and linking `libRCTContacts.a` in Build Phases).