{"id":288685,"date":"2019-06-06T07:21:09","date_gmt":"2019-06-06T14:21:09","guid":{"rendered":"http:\/\/css-tricks.com\/?p=288685"},"modified":"2019-06-06T07:21:09","modified_gmt":"2019-06-06T14:21:09","slug":"how-to-use-the-web-share-api","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/how-to-use-the-web-share-api\/","title":{"rendered":"How to Use the Web Share API"},"content":{"rendered":"

The Web Share API<\/a> is one that has seemingly gone under the radar since it was first introduced in Chrome 61 for Android. In essence, it provides a way to trigger the native share dialog<\/strong> of a device (or desktop, if using Safari) when sharing content \u2014 say a link or a contact card \u2014 directly from a website or web application.<\/p>\n

While it\u2019s already possible for a user to share content from a webpage via native means, they have to locate the option in the browser menu, and even then, there\u2019s no control over what gets shared. The introduction of this API<\/abbr> allows developers to add sharing functionality into apps or websites by taking advantage of the native content sharing capabilities on a user\u2019s device.<\/p>\n

\"\"
iOS offers a number of native sharing options.<\/figcaption><\/figure>\n

<\/p>\n

This approach provides a number of advantages over conventional methods:<\/p>\n