简体   繁体   English

单击移动网站中的链接应打开whatsapp应用

[英]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 我不想在whatsapp中共享文本,只想在我尝试点击时打开whatsapp应用

<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 引用的几个链接如何同时单击超链接/图像/按钮时仅打开whatsapp应用程序 Whatsapp html调用链接

But couldn't get the exact answer. 但无法获得确切答案。

From Whatsapp documentation : Whatsapp文档中

WhatsApp provides a custom URL scheme to interact with WhatsApp: WhatsApp提供了一个自定义URL方案以与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. 如果您有一个网站,并希望使用预填的消息来打开WhatsApp聊天,则可以使用我们的自定义URL方案来进行。 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. 打开whatsapp:// send?text =,后跟要发送的文本,将打开WhatsApp,允许用户选择联系人,并用指定的文本预填充输入字段。

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...) (从移动设备上点击时...)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM