January 15, 2022 04:14 pm GMT
Original Link: https://dev.to/sh20raj/how-to-add-whatsapp-share-button-on-a-website--1kdj
How to add WhatsApp share button on a website ?
Here are two methods which can be used to link a button. When user will click it. The user will be redirected to WhatsApp app on Android/PC. With the massage given in the parameter.
<a href="https://api.whatsapp.com/send?text=urlencodedtext"></a>
<a href="whatsapp://send?text=<<HERE GOES THE URL ENCODED TEXT YOU WANT TO SHARE>>" >Share via Whatsapp</a>
<a href="https://wa.me/?text=urlencodedtext">Share this</a>
As you seen in the example if you want to add line breaks to your massage or write massage as you send on WhatsApp. You have to use urlencodedtext.
You can Convert your Text into URL encoded text from here :- https://www.google.com/search?q=url+text+encoder
As you can See an Example Here :- https://createevminutes.sh20raj.repl.co/
Original Link: https://dev.to/sh20raj/how-to-add-whatsapp-share-button-on-a-website--1kdj
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To