Share with native app

Share web page like a native app

Adding a share button on the website is easy. You can use free tools, plugins like AddThis, ShareThis, and more. But, free means extra cost. How?

Share Buttons

Whenever your visitor browses your website, the web page is download on a browser with all these supported files of AddThis (or similar plugin) like

<!-- Go to to customize your tools -->  <script type="text/javascript" src="//"></script>  

This causes extra load time of the web page. These plugins seem okay when your visitor comes from desktop. But, on mobile these take space and native sharing is already in the android, ios browsers. So, no need to use plugins like AddThis and ShareThis if your visitors come only from mobile.

Share buttons on Mobile (to open native apps)

Share Native App

Here i am going to tell you how you can use both


<div id='fornative' style="display:none">
<a href='#' onClick="return shareme()" class="btn btn-primary">Share</a>
<!-- Go to to customize your tools -->
<div id='foraddthis' class="addthis_inline_share_toolbox" data-title="title" data-description="description" ></div>

I am using two div block in my webpage, 1st is for the native share button and 2nd for AddThis sharing buttons. You can see that 1st div name ‘fornative’ is hidden by default.


} else {
    var script = document.createElement("script");
        script.type = "text/javascript";
        script.src = "//";

Herewith the help of Web Share API, check native share is supported by the browser, if supported then our native share button will be visible, if not only then dynamically script required for sharing buttons is downloaded.

With the help of below code i can share the content on native apps

const shareData = {
            title: 'Title',
            text: 'description',
            url: 'url to share',

function shareme()
    if (navigator.share) {
    return false;

If you like this, you can leave comment and suggestion about sharing buttons