@timnoetzel/capacitor-contact-picker
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@timnoetzel/capacitor-contact-picker

This package allows you to use the native contact picker UI on Android or iOS for receiving contact information. iOS supports selecting multiple contacts. Android only support single selection. Both platforms will return the same payload structure, where the data exists.

Installation

yarn add @timnoetzel/capacitor-contact-picker
// or
npm i @timnoetzel/capacitor-contact-picker

Android

Register the plugin class in your MainActivity.java:

import com.timnoetzel.capacitor.ContactPicker;

public class MainActivity extends BridgeActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        ...
        add(ContactPicker.class);
    }
}

Usage

import { Plugins } from '@capacitor/core';

const { ContactPicker } = Plugins;

async openPicker() {
    const res = await ContactPicker.open();
    // res.value is an array of contacts
}

Readme

Keywords

Package Sidebar

Install

npm i @timnoetzel/capacitor-contact-picker

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

262 kB

Total Files

94

Last publish

Collaborators

  • tnoetzel