Create a link that will open Viber and WhatsApp and will send a message to me
Solution 1
What you need is called deep-linking, some examples for viber
and whatsapp
are:
Viber:
<a href="viber://pa?chatURI=[public account URI]&text=[message text]"> some text </a>
WhatsApp:
<a href="whatsapp://send?abid=[users name]&text=[message text]"> some text </a>
While not a deep link, you can also use the following url (don't use +
on phone) for WhatsApp:
<a href="https://api.whatsapp.com/send?phone=0000000">Contact Me</a>
Sources:
http://origamiengine.com/deep-linking
https://support.viber.com/customer/en/portal/articles/2872423-deep-links
Solution 2
Viber link to user should be like this:
viber://contact?number=%2B0000000000000
Use international telephone number format without +
but with %2B
.
Solution 3
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.
Solution 4
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>
Solution 5
viber://chat?number=%2B977-9800000000
For me, this worked for both desktop and mobile. I replaced + with %2B.
Alexander
Updated on July 05, 2022Comments
-
Alexander almost 2 years
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?
-
Alexander over 7 yearsThank you, but this will send a predefined message to me, isn't it, and I don't want that, I do want to open a chat windows on visitor's PC so he/she can type me his own message. Is it possible? Still see no docs on this on Viber and WA sites.
-
Alexander over 7 yearsAnd no, I don't want to establish public account on Viber for this very purpose, I'd like to have a chat with my ordinary Viber account!
-
Svetoslav Stefanov almost 3 yearsThank you. By the current date, the link with
+PHONE_WITH_PLUS
works for both Desktop & mobile. -
Giannis Savvidis over 2 yearsText param does nothing as of 2021. It seem to work if you do href="viber://forward?text=test" but not if you do href="viber://chat?number=%2B1111111&text=test" it opens an empty chat.
-
Haris Papadakis over 2 yearsIs that working for desktop app and mobile app?