Whatsapp 点击聊天 "Couldn't open link" 错误 Chrome Android/iPhone

Whatsapp Click-to-Chat "Couldn't open link" Error Chrome Android/iPhone

我正在使用 Whatsapp 点击聊天功能,但没有 phone 号码。它以前有效,但使用新的 Chrome 版本 76.0.3809.132,在 iOS 和 Android 上都不再有效。在 Android 上,它显示 无法打开 link 的 Toast。尝试联系 Whatsapp 支持,但目前还没有答复。在最新更新中,他们自己的文档示例不起作用,link to docs。有什么建议或经验吗?

Link 示例:

<a target="_blank" href="https://wa.me/?text=Villa%20stone%20road%20piece%2015%20meters%20from%20the%20asphalt%20street" title="Share on WhatsApp">

错误图片Imgur:picture

A table 在 Imgur

上有 my tested devices and versions

似乎chrome不接受未指定号码的点击聊天。一旦 URL 中有一个数字,它就可以正常工作。
不幸的是,我没有找到绕过它的黑客。这两个都不起作用:
https://wa.me//?text=Hello%20World
https://wa.me/0/?text=Hello%20World
只有指定了正确的号码,它才会打开 WhatsApp,但收件人已经预先选择(我们提供的号码)。

大约 2 周前,我为一位客户测试了它,当时它仍然有效。所以 Chrome 的最后更新(从 8 月 26 日开始)似乎是问题所在...

如果您使用 https://api.whatsapp.com/send 而不是 https://wa.me/,则不需要指定 phone 数字。

例如

https://api.whatsapp.com/send?text=Your%20Custom%20Text

最好使用自定义url方案格式。通用链接不适用于本机客户端

whatsapp://send/?phone=&text&source&data

没有 phone 号码也可以。

我关于最近重大更改的问题:

There was a great blog post 关于这个问题,但是它已经过时并提出了一个 php 具体的解决方案(尽管如此可能会给你一个好主意,如何思考这个问题)

首先:Official Whatsapp Sharing Documentation。建议将以下网址之一用于 WEB 使用...

https://api.whatsapp.com/send?text=YourShareTextHere

https://api.whatsapp.com/send?text=YourShareTextHere&phone=123

这些 MOBILE 使用...

whatsapp://send?text=YourShareTextHere

whatsapp://send?text=YourShareTextHere&phone=123

如果您有兴趣观看跟踪这些 URL 的项目,请查看我们!:https://github.com/bradvin/social-share-urls#whatsapp

const text = "Hello..."

const phoneNumber = "23400000000000"


Linking.openURL(`whatsapp://send?text=${text}&phone=${phoneNumber}`)