This content originally appeared on DEV Community and was authored by Shaswat Raj
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/
This content originally appeared on DEV Community and was authored by Shaswat Raj
Shaswat Raj | Sciencx (2022-01-15T16:14:34+00:00) How to add WhatsApp share button on a website ?. Retrieved from https://www.scien.cx/2022/01/15/how-to-add-whatsapp-share-button-on-a-website/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.