Skip to content

shercoder/react-native-contact-picker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-contact-picker

  • Support to open contact sheet and select a user and get their emails back.

Getting started

npm install doctadre/react-native-contact-picker

iOS

  1. In XCode, in the project navigator, right click your projectAdd Files to [your project's name]
  2. Go to node_modulesreact-native-contact-picker and add ContactPicker.m
  3. Run your project (Cmd+R)

Android

if you do not have rnpm: npm install rnpm -g

rnpm link react-native-contact-picker

In AndroidManifest.xml

	<!--add contact picker permissions-->
   <uses-permission android:name="android.permission.READ_CONTACTS"/>

Usage

Require the module var ContactPicker = require('NativeModules').ContactPicker;

'use strict';

var React = require('react-native');
var ContactPicker = require('NativeModules').ContactPicker;

then invoke:

    onButtonPress() {
        ContactPicker.pickContact().then((emails) => {
            if (emails && emails.length) {
                // list of contacts emails as strings
            } else {
             // either user hit cancel or the person they picked has no emails
            }
        });
    }

License

MIT

About

Contact Picker for react native

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 62.9%
  • Objective-C 37.1%