5

I'm using the link wa.me in a web application for open a chat with a message with emojis. With the message like "Hi " the formed link is like this:

https://wa.me/XXXXXXXXXXXXX?text=Hi+%F0%9F%98%89

When the user opens this link on the smartphone everything is fine, but on the desktop (and WhatsApp Web) the message is sent as "Hi �"

The emoji is encoded correctly ("%F0%9F%98%89"). I found that if I use the old api.whatsapp.com/send instead wa.me, I don't have this error. Could there be something wrong when wa.me redirects to the old api.whatsapp? I'm afraid to use the api.whatsapp in production because the whatsapp documentation doesn't talk about it anymore, and can be changed without notice, I imagine.

Gustavo Fabro
  • 71
  • 1
  • 3

1 Answers1

7

I stumble upon this GitHub repo: Social Share URLs That has a complete and updated way of using link on how to share to different social networks.

I stopped using:

https://wa.me/XXXXXXXXXXXXX?text=Hi+%F0%9F%98%89

And now I do it like:

https://api.whatsapp.com/send?phone=XXXXXXXXXXXXX&text=Hi+%F0%9F%98%89

and it works perfectly fine with emojis! In the preview of the API webpage shows the � symbol, but when entering the Whatsapp App it shows the emoji correctly!

sebasira
  • 1,739
  • 1
  • 22
  • 41