问题描述
我有一个网络应用程序,我正在尝试共享指向 WhatsApp 网络应用程序的链接,但不在移动应用程序中.
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.
我已经浏览了分享 WhatsApp 网页版链接?但没有提供解决方案.
I have gone through Sharing link for WhatsApp Web version? but no solution is provided.
可行吗?
到目前为止我尝试了什么
What have I tried till now
<a href="whatsapp://send?text=www.google.com" data-action="share/whatsapp/share">Share via Whatsapp</a>
此代码可帮助我通过 WhatsApp 移动应用程序共享它.有没有办法在 WhatsApp 网络应用程序中做同样的事情?
This code helps me to share it via WhatsApp mobile application. Is there a way to do the same in WhatsApp web application?
推荐答案
此链接 - 将始终打开浏览器,即使您使用的是移动设备.
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>
但是在使用 api.whatsapp.com
时 - 它会首先尝试打开桌面上的 whatsapp 移动应用程序或 whatsapp 网络(如果存在),如果不存在 - 它将打开其他合适的应用程序.
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.
<a href="https://api.whatsapp.com/send?text=www.google.com" data-action="share/whatsapp/share">Share via Whatsapp web</a>
所以 api
对我来说效果最好
So the api
worked best for me
这篇关于分享从我的网站到 WhatsApp 网络应用程序的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!