Adding whatsapp share button on website, for iOS8. I am using the following:
<spanid="whatsapp_share_android">
<a href="whatsapp://send?text={{my_meta.og_title.value}} - http://{{ request.get_host }}{{entity.url}}%3Futm_source=whatsapp%26utm_medium=referral" data-action="share/whatsapp/share" onmousedown="_paq.push(['trackEvent','Share on Whatsapp','Mobile','{{request.get_full_path}}']); ga('send', 'event','Share on Whatsapp','Mobile','{{request.get_full_path}}');ga('mobileTracker.send', 'event','Share on Whatsapp','Mobile','{{request.get_full_path}}');"><img src="{{ STATIC_URL }}images/whatsapp_icon.png" /></a>
</span>
It works on android but not on iOS
According to the WhatsApp FAQ for app integration, your URL scheme should work:
I assume that everything within brackets in your sample code will be replaced by your app? Also there needs to be a space between the span
tag and its id
attribute.
How about if you try it with this simple example on both platforms:
<a href="whatsapp://send?text=Hello%20World!">Hello, world!</a>
As of 2021/03/01, WhatsApp documentation states: "Universal links are the preferred method of linking to a WhatsApp account. Use https://wa.me [...]"
Example:
const whatsAppURL = `https://wa.me?text=${encodeURIComponent('The message to send')}`;
What's the difference with whatsapp://
? wa.me
works on desktop and mobile (hence the term "Universal links") while whatsapp://
only works on mobile with the WhatsApp application installed.
wa.me
even works with the web version of WhatsApp: https://web.whatsapp.com/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With