Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start WhatsApp from URL HREF with custom text/content

Tags:

As you know using the whatsapp url scheme on iphone i can create the following link:

href="whatsapp://send?text=blahblah"

this is possible due to the url scheme support on ios.

im try to create the similar effect for android devices. (but no threw android app, just a normal html page).

to my understanding it should be something like:

href="intent://send/#Intent;scheme=whatsapp;package=com.whatsapp;s.text=test;end;"

or:

href="intent://send/#Intent;scheme=whatsapp;package=com.whatsapp;text=test;
     action=android.content.Intent.ACTION_SEND; end"

or:

href="intent://send/#Intent;scheme=whatsapp;package=com.whatsapp;text=test;
      category=android.intent.category.BROWSABLE;end"

as you can see im really groping in the dark. all the answers i've found on stackoverflow are talking about how to generate the intent threw the android app.

BUT thats not my case, i want to generate an href on a PHP/ASP server for an html page.

someone? thanks!

like image 584
edan_develop Avatar asked Feb 01 '14 16:02

edan_develop


People also ask

How can I connect WhatsApp with href?

Universal links are the preferred method of linking to a WhatsApp account. Use https://wa.me/<number> where the <number> is a full phone number in international format. Omit any brackets, dashes, plus signs, and leading zeros when adding the phone number in international format.

How can send WhatsApp message in HTML?

One has to send a pre-filled text message to the custom URL scheme using an anchor tag. Opening Whatsapp://send?text= followed by the text to send, will open WhatsApp. The user can now choose a contact, and pre-fill the input field with the specified text.


2 Answers

whatsapp now officially support url scheme over Android(Yey)!

<a href="whatsapp://send?text=Hello%20World!">Hello, world!</a>

for more details visit http://www.whatsapp.com/faq/en/android/28000012

like image 178
edan_develop Avatar answered Oct 15 '22 15:10

edan_develop


Was working on the same Problem and found the solution:

href="intent://send/[countrycode_without_plus][number]#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end

With a telephonenumber(+49 123 456 78)

href="intent://send/4912345678#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end
like image 24
kadir Avatar answered Oct 15 '22 15:10

kadir