Pradeep S
Pradeep S

Reputation: 31

How can I retrieve multiple contacts in Ionic using the Cordova contacts plugin?

I am currently using the navigator.contacts.pickContact() function, which only returns a single contact. Instead of getting a single contact, I would like to get multiple contacts at the same time. I have tried using the navigator.contacts.find() function, but it returns the whole contact list. How can I get multiple contacts using this plugin?

Upvotes: 0

Views: 1524

Answers (1)

Jorge
Jorge

Reputation: 560

It can't be done directly with the plugin the way you want. You have to do a navigator.contacts.find(['*'], (contacts) => {}) retrieve all contacts and make a custom component to select only those that you want. The plugin directly don't allow to show a multi-picker.

Upvotes: 2

Related Questions