9

Javascript Tip: How to fetch phone contact list on the web in Android ? | Contac...

 3 years ago
source link: https://dev.to/jyotishman/tip-how-to-fetch-your-phone-contact-list-on-the-web-in-android-4j27
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Cover image for Javascript Tip: How to fetch phone contact list on the web in Android ? | Contact Picker API

Javascript Tip: How to fetch phone contact list on the web in Android ? | Contact Picker API

Jun 5

・1 min read

Did you know you can access your contact list on the web in Android ?

Chrome recently launched an API that allows you to fetch contact data from your phone and you can share those data in your webapp.

But to use this Contact Picker API there are certain restrictions-

  1. Contact Picker API will run only on chrome > v80.
  2. Application should run on https protocol.
  3. Contact Picker API will work only on mobile android.

You can check if you chrome browser support this API or not by -

const supported = "contacts" in navigator && "ContactsManager" in window;

There are multiple customisations that are available in this Contact Picker API-

  1. Picker has the option of Single / Multi select contact data.
  2. Filter of data like Name, Email, Address, Tel etc are there.

Demo Codepen- https://codepen.io/jyotishman/pen/vYxjZaE
Demo GitHub- https://jyotishman.github.io/contactpicker/
Source code- https://github.com/jyotishman/contactpicker


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK