# react-native-contacts-wrapper **Repository Path**: mirrors_DylanVann/react-native-contacts-wrapper ## Basic Information - **Project Name**: react-native-contacts-wrapper - **Description**: Contacts plugin to wrap native contact pickers for iOS and Android. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-10-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # react-native-contacts-wrapper ![alt tag](https://github.com/LynxITDigital/Screenshots/blob/master/RN%20Contacts%20Wrapper%20example.gif) This is a simple wrapper for the native iOS and Android Contact Picker UIs. When calling the API functions, the appropriate picker is launched. If a contact is picked, the promise is resolved with the requested data about the picked contact. This uses the ContactsContract API for Android, AddressBook library for iOS8 and below and the new Contacts library for ios9+. The API is currently very basic. This was started just as a way of selecting a contact's email address. The getContact function was added as a more generic way of returning contact data. Currently this returns Name, Phone and Email for picked contact. In future more fields will be added to this, and possibly more specific methods similar to getEmail. Feel free to extend the functionality so it's more useful for everyone - all PRs welcome! ## Installation ### Automatic (works for iOS without condition; for Android with RN 0.28 and before) If you have rnpm installed, all you need to do is ``` npm install react-native-contacts-wrapper --save rnpm link react-native-contacts-wrapper ``` ### Manual #### Android (with RN 0.29 and above) in `settings.gradle` ``` include ':react-native-contacts-wrapper' project(':react-native-contacts-wrapper').projectDir = new File(settingsDir, '../node_modules/react-native-contacts-wrapper/android/app’) ``` in `android/app/build.gradle` ``` dependencies { compile project(':react-native-contacts-wrapper') ``` in `MainApplication.java` add package to getPacakges() ``` import com.lynxit.contactswrapper.ContactsWrapperPackage; ... @Override protected List getPackages() { return Arrays.asList( new MainReactPackage(), ..., new ContactsWrapperPackage() ); } ``` in `AndroidManifest.xml` make sure you have the following setting even if you have done `react-native upgrade` ``` { this.importingContactInfo = false; console.log("email is", email); }) .catch((error) => { this.importingContactInfo = false; console.log("ERROR CODE: ", error.code); console.log("ERROR MESSAGE: ", error.message); }); ```