3

I'm using this approach: https://stackoverflow.com/a/25796908/3437433

It works like a charm, but when I'm trying to use it in Safari (both desktop and mobile), then quite strange things happen.

On desktop, origin link https://wa.me/?text=123 is somehow replaced with whatsapp://send?text=123. And then Safari displays error page about wrong protocol.

On mobile, correct page is opened by origin link, but also alert appears saying "can't open page because url is wrong". I can close that alert, can click on "send" button, but then https://whatsapp.com/download/ page is opened, instead of prompting to login to whatsapp and redirecting to chat.

Does anybody know what's going on here and whether it can be fixed?

jeron-diovis
  • 788
  • 1
  • 8
  • 19

2 Answers2

2

We usually differ link at desktop view and mobile view to offer support for safari and other browser. for desktop view we use https://web.whatsapp.com/send?phone=6200000000&text=Hello%20Moxqitto

for mobile, we follow whatsapp best practice https://faq.whatsapp.com/en/android/26000030/ https://wa.me/6200000000

Tested on Chrome for mac safari for mac android chrome

Ps: not tested when mac have whatsapp desktop app, but it will still work in the safari itself. so it should be ok

MPlify
  • 31
  • 4
  • are you aware of an api that checks if a phone number is connected with whatsapp? – Shuaib Zahda Dec 29 '18 at 17:39
  • as far as I know, it is currently only available for whatsapp business api which is still for select-invite only . You can request for the access at https://www.facebook.com/business/m/whatsapp/business-api – MPlify Jan 12 '19 at 04:14
2

Official Sharing Documentation For WhatsApp. They say to use their wa.me/... URL. Okay! So let's try it out! http://wa.me/?text=mytest For me, I get an error message...

PAGE NOT FOUND

However, these seem to work great for me!

https://api.whatsapp.com/send?text=YourShareTextHere

https://api.whatsapp.com/send?text=YourShareTextHere&phone=123

If you are interested in watching a project that keeps track of these URLs, then check us out!: https://github.com/bradvin/social-share-urls#whatsapp

Social Share URLs

HoldOffHunger
  • 18,769
  • 10
  • 104
  • 133