How to add WhatsApp sharing to your web application

1. copy and paste this url in your page where you want to have whatsapp sharing
<a href="whatsapp://send" data-text="Take a look at this awesome website:" data-href="http://jadanusha.blogspot.in/" class="wa_btn wa_btn_s" style="display:none">Share</a>

2.Download the js file and add to your application
https://github.com/kriskbx/whatsapp-sharing/releases
3. Include the downloaded JavaScript file right before the end of
</body>,
replace the url/to/your/button/whatsapp-button.js with the url to the uploaded file:
Add this script in the file below where you are adding the whatsapp-sharing

<script type="text/javascript">
if(typeof wabtn4fg==="undefined")
{
wabtn4fg=1;h=document.head||document.getElementsByTagName("head")[0],s=document.createElement("script");
s.type="text/javascript";
s.src="url/to/your/button/whatsapp-button.js";
h.appendChild(s);
}
</script>

Once you are done host your application online and open in your mobile and click the whatsapp-button
now you can share the contenet in the whatsapp contacts

You can see the original post at http://whatsapp-sharing.com/

No comments:

Post a Comment