react-native library for selecting contact from native android and iOS contacts picker.
yarn add react-native-contact-select
or
npm install react-native-contact-select
Run pod install for iOS
pod install --project-directory=ios
For iOS you don't need to handle permissions because native CNContactPickerViewController
is being used.
For android add following to your AndroidManifest.xml
:
<uses-permission android:name="android.permission.READ_CONTACTS" />
Permission will automatically be requested when you call for selectContact
method.
import { selectContact } from 'react-native-contact-select';
selectContact().then(contact => {
// do something with contact
}).catch(error => {
// handle error
})
MIT
Project bootstrapped with react-native-builder-bob