Html 分享从我的网站到 WhatsApp 网络应用程序的链接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38436802/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Share a link from my website to WhatsApp web application
提问by Raja Dhasan
I have a web application and in that, I am trying to share a link to WhatsApp web application and but not in mobile app.
我有一个 Web 应用程序,在该应用程序中,我尝试共享指向 WhatsApp Web 应用程序的链接,但不在移动应用程序中。
I have gone through Sharing link for WhatsApp Web version?but no solution is provided.
我已经浏览了WhatsApp 网页版的分享链接?但没有提供解决方案。
Is it feasible?
可行吗?
What have I tried till now
到目前为止我尝试了什么
<a href="whatsapp://send?text=www.google.com" data-action="share/whatsapp/share">Share via Whatsapp</a>
This code helps me to share it via WhatsApp mobile application. Is there a way to do the same in WhatsApp web application?
此代码帮助我通过 WhatsApp 移动应用程序共享它。有没有办法在 WhatsApp 网络应用程序中做同样的事情?
回答by Ricky Levi
This link - will always open a browser, even if you're in mobile.
此链接 - 将始终打开浏览器,即使您使用的是移动设备。
<a href="https://web.whatsapp.com/send?text=www.google.com" data-action="share/whatsapp/share">Share via Whatsapp web</a>
But when using the api.whatsapp.com
- it will try to first, open the whatsapp mobile application OR whatsapp web on desktops if exists, if not - it will open other suitable app.
但是在使用时api.whatsapp.com
- 它会首先尝试打开桌面上的 whatsapp 移动应用程序或 whatsapp web(如果存在),如果不存在 - 它会打开其他合适的应用程序。
<a href="https://api.whatsapp.com/send?text=www.google.com" data-action="share/whatsapp/share">Share via Whatsapp web</a>
So the api
worked best for me
所以api
对我来说效果最好
回答by mahmud
this work for me
这对我有用
<a href="https://web.whatsapp.com/send?text=www.google.com" data-action="share/whatsapp/share">Share via Whatsapp web</a>