Everyone around used to use IM. On my site I need to put a link that will open given instant messaging application (both on PC and on mobile) and open a send message to my number - and I can't find a way!
I suppose to use some URL scheme to do that, but all I can find is (__number is my mobile phone number):
<a href="intent://send/__number__#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end">WhatsApp</a>
and
<a href="viber://add?number=__number__">Viber</a>
(I don't even know if I should use phone in +1202... or simple 1202... (that is, if the plus is needed)
but frankly speaking it won't work. Viber opens its window and then tells me it won't handle that request, and WhatsApp is not linked to intent
scheme at all (tested at several devices and OSes).
So I please ask you to help me with this small problem: what kind of URL will open Viber and WhatsApp apps to let visitors of the site to contact me?
What you need is called deep-linking, some examples for viber
and whatsapp
are:
<a href="whatsapp://send?abid=[users name]&text=[message text]"> some text </a>
<a href="viber://pa?chatURI=[public account URI]&text=[message text]"> some text </a>
Sources:
http://origamiengine.com/deep-linking
https://support.viber.com/customer/en/portal/articles/2872423-deep-links
For WhatsUp you can use this link, that will open a chat with you on mobile, just enter your phone without the + sign.
<a href="https://api.whatsapp.com/send?phone=123456789">WhatsUp</a>
Since you don't want to create a public account (aka viber links including /pa? ) then simple add the link: <a href="viber://chat?number=012345678901"">chat with me</a>
The first two digits are country code and no + sign needed.
For whatsapp it is easy.
use the following format
**https://wa.me/123456/**
and that's it. here 123456 means your whatsapp number with the country code.
Don't include + or preceding 00 just put your number with the country code. like 912232232.
Here 91 is country code and the rest is the phone number. this works with the app, and also for whatsapp web.
for Viber this format works with public accounts. if you have a viber username you can use the same method.
https://viber.me/username/
will send you to the page.
this even work for facebook. if your facebook profile is visible to search engines, you can use this method.
use the above format with
fb.me/username
this will redirect you to the facebook page of the user. I think it works for pages too. but I haven't tried.I believe it should work.
Actually viber://add?number=XXXXXXXXX
is not working for Desktop app, it's working only if you open from Mobile phone. For desktop you need to use viber://chat?number=XXXXXXXXX
.
For whatsapp link is very simple: https://wa.me/XXXXXXXXXX
.
Remember how to generate links for all messengers is unreal, so I always use https://msng.link/ for generating whatsapp and telegram link, it's very easy.
Viber link to user should be like this:
viber://contact?number=%2B0000000000000
Use international telephone number format without +
but with %2B
.