从 Android 的移动网站(不是应用程序)在 WhatsApp 上共享链接 [英] Sharing link on WhatsApp from mobile website (not application) for Android

查看:23
本文介绍了从 Android 的移动网站(不是应用程序)在 WhatsApp 上共享链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个主要用于手机的网站.
我希望允许用户直接从网页将信息共享到 WhatsApp.

I have developed a website which is mainly used in mobile phones.
I want to allow users to share information directly from the web page into WhatsApp.

使用 UserAgent 检测我可以区分 Android 和 iOS.
我发现为了在 iOS 中实现上述内容,我可以使用 URL:

Using UserAgent detection I can distinguish between Android and iOS.
I was able to discover that in order to implement the above in iOS I can use the URL:

href="whatsapp://send?text=http://www.example.com"

我仍在寻找操作系统为 Android 时使用的解决方案(因为上述方法不起作用).
我想这与在 Android 中使用意图"有某种关系,但我不知道如何将其作为 href 的参数.

I'm still looking for the solution to be used when the OS is Android (as the above doesn't work).
I guess it is somehow related to using "intent" in Android, but I couldn't figure out how to do it as parameter for href.

推荐答案

刚刚在一个网站上看到它,似乎现在也可以在最新的 Android 上运行最新的 chrome 和 whatsapp!给链接一个新的镜头!

Just saw it on a website and seems to work on latest Android with latest chrome and whatsapp now too! Give the link a new shot!

<a href="whatsapp://send?text=The text to share!" data-action="share/whatsapp/share">Share via Whatsapp</a>

今天(2015 年 4 月 17)重新检查:
适用于 iOS 8(iPhone 6,最新版本)Android 5(Nexus 5,最新版本).

Rechecked it today (17th April 2015):
Works for me on iOS 8 (iPhone 6, latest versions) Android 5 (Nexus 5, latest versions).

它也适用于 Windows Phone.

It also works on Windows Phone.

这篇关于从 Android 的移动网站(不是应用程序)在 WhatsApp 上共享链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆