Chandrika Desai
Chandrika Desai

Reputation: 97

Clicking a link in mobile website should open whatsapp app

I dont want to share text in whatsapp, just want to open whatsapp app on click I tried

<a href="whatsapp://" class="btn whatsapp-btn btn-outline whatsapp-outline btn-block" >Create group</a>

Referred couple of links how to open only whatsapp application when click on a hyperlink/image/button also Whatsapp html call link

But couldn’t get the exact answer.

Upvotes: 0

Views: 6517

Answers (1)

Ronen Cypis
Ronen Cypis

Reputation: 21470

From Whatsapp documentation:

WhatsApp provides a custom URL scheme to interact with WhatsApp:

If you have a website and want to open a WhatsApp chat with a pre-filled message, you can use our custom URL scheme to do so. Opening whatsapp://send?text= followed by the text to send, will open WhatsApp, allow the user to choose a contact, and pre-fill the input field with the specified text.

So, this should work:

<a href="whatsapp://send?text=YoYoYo" class="bla">Whatsapp link</a>

And if i'm lucky, also this! (when clicked from mobile device...)

Upvotes: 4

Related Questions