The Whatsapp wa.me link does not correctly display the emoji sent in the text parameter on the desktop and web
Asked Answered
E

2

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.

Escolar answered 5/4, 2021 at 14:27 Comment(2)
Have you find a way to solve this?Runion
Unfortunately no, I've sent a message to the Whatsapp support, and after a long chat (looks like they were ignoring me) they said that will analyzeEscolar
R
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!

Runion answered 28/7, 2021 at 13:57 Comment(2)
Yeah, as I said in the question, api.whatsapp works, but documentation say to use the wa.me now.Escolar
Sorry! I got in my head the idea that wa.me not working and I totally forget you already said that api.whatsapp.worksRunion
W
0

The API api.whatsapp.com is not working with emojis anymore,

For desktop you should use WhatsApp WEB

https://web.whatsapp.com/send?phone=${phoneNumber}&text=Hi+%F0%9F%98%89

For mobile you should use the WhatsAPP protocol instead

whatsapp://send?phone=${phoneNumber}&text=${message}

Whirlpool answered 5/7, 2024 at 1:30 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.