1.0.0 • Published 4 years ago

capacitor-contact-picker-petervelosy v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

capacitor-contact-picker-petervelosy

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

npm i capacitor-contact-picker-petervelosy

Android

Register the plugin class in your MainActivity.java:

import com.teamhive.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
}
1.0.0

4 years ago