capacitor-community / contacts

Contacts Plugin for Capacitor
https://capacitor-community.github.io/contacts/
119 stars 52 forks source link

Pick Contact #46

Closed atrefab closed 1 year ago

atrefab commented 3 years ago

Describe the solution you'd like I wonder if it would possible to have a method inside the plugin to pick a single contact by using the OS native UI as the Cordova deprecated plugin did through the method pickContact.

Describe alternatives you've considered

Additional context

muuvmuuv commented 3 years ago

We would need the same. Building a modal ATM for it.

Idrimi commented 3 years ago

Hi @muuvmuuv & @atrefab,

what would be your use-cases? Couldn't you solve it by picking a contact in JS after fetching the contacts? My priority is to keep the plugin as light & maintainable as possible. Implementing a native view would be kind of heavy.

atrefab commented 3 years ago

Hi @Idrimi, The problem I have when using the plugin is that fetching all contacts is too slow (i tested on a phone with more than 900 contacts). When using the old Cordova plugin with pickContact method, the native show contact UI is called and that's super fast for picking a single contact. I don't know if it will necessary to implement a native view inside the plugin or just call the right intent and start the activity.

muuvmuuv commented 2 years ago

The same in our case, our customers use our app on company tablets on fairs where all contacts are synced with the company. The Ionic Modal would take way longer than a native "search and select".

moblizeit commented 2 years ago

useful for us as well to be able to search contacts without pulling entire address book

wwwguy commented 1 year ago

Any update on this? unusable for us without pickcontact (ie as mentioned takes way too long to pull all contacts when our use case is just to choose a single contact from the devices native contact list display like it was before)

tafelnl commented 1 year ago

A new major of this plugin just got released as a beta version. The plugin is refactored quite a bit. Among others, the API and TypeScript definitions got improved.

It also ships your request: you will now be able to pick a contact using the native contact picker available on Android and iOS (docs).

Check out the newly added docs here: https://capacitor-community.github.io/contacts

Mind you that the new version (v3 and v4) are currently still in beta. However, the beta is tested quite extensively and fairly stable. If you're willing to test it out in your project, it would be much appreciated!