Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a link that will open Viber and WhatsApp and will send a message to me

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?

like image 685
Alexander Avatar asked Dec 25 '16 20:12

Alexander


2 Answers

Viber link to user should be like this:

viber://contact?number=%2B0000000000000

Use international telephone number format without + but with %2B.

like image 177
Iggy Avatar answered Oct 04 '22 23:10

Iggy


viber://chat?number=%2B977-9800000000

For me, this worked for both desktop and mobile. I replaced + with %2B.

like image 27
Leutecia Avatar answered Oct 05 '22 01:10

Leutecia