Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
176
rated 0 times [  182] [ 6]  / answers: 1 / hits: 18994  / 6 Years ago, sun, february 4, 2018, 12:00:00

I'm developing a hybrid app for android. I've added the following code:





<a href=whatsapp://send data-text=mytext>Send message to WhatsApp</a>
<a href=whatsapp://send?text=Hello%20World!>Hello, world!</a>





However, when I click on those links on my phone, whatsapp doesn't pop-up. Can you, please, help me out? Why isn't that message being shared?



Thanks in advance!


More From » android

 Answers
64

This is the URL you should use:


https://api.whatsapp.com/send?phone=15551234567&text=I'm%20interested%20in%20your%20car%20for%20sale

In JavaScript, you must encode the text for e.g.


var url='https://api.whatsapp.com/send'
var text='text can contain this char: &'
window.open(url + '?phone=2211227373&text=' encodeURIComponent(text))

[#55262] Thursday, February 1, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dakotahs

Total Points: 605
Total Questions: 104
Total Answers: 113

Location: Hungary
Member since Wed, Nov 9, 2022
2 Years ago
;