简体   繁体   English

如何制作Whatsapp共享框

[英]How to make Whatsapp share box

Working on a new website, with an option to share the page: I made the Facebook share with image and title description etc... 在一个新网站上工作,可以选择共享页面:我通过图像和标题描述等方式在Facebook分享了...

Now I want to make a Whatsapp share too, but when I look in Whatsapp API I see only text mention. 现在,我也想共享一个Whatsapp共享,但是当我查看Whatsapp API时,只会看到文字提示。

But I see places that do make share box on whatsapp... 但我看到确实在whatsapp上建立了共享框的地方...

Here some image example I found in google images: 这是我在Google图片中找到的一些图片示例:

在此处输入图片说明

Please help me understand how to define this and make a href button of it 请帮助我了解如何定义它并为其创建href按钮

Thanks! 谢谢!

There is no official Whatsapp API you could use for sending messages from a PC. 没有可用于从PC发送消息的官方Whatsapp API。 The only "API" Whatsapp provides is the sharing API for mobile phones and the whatsapp:// protocol - which does only work on clients having Whatsapp installed. Whatsapp唯一提供的“ API”是用于手机和whatsapp://协议的共享API-仅在安装了Whatsapp的客户端上有效。

Using that whatsapp:// protocol, you can send a message containing text-only. 使用whatsapp://协议,您可以发送包含纯文本的消息。 Whatsapp will automatically resolve contained URLs and display image and title according to the screenshot you linked. Whatsapp将根据您链接的屏幕快照自动解析包含的URL并显示图像和标题。

Taking a look at the example at crunchify , they do exactly the same thing. 看一下crunchify示例 ,他们做的完全一样。

$whatsappURL = 'whatsapp://send?text='.$crunchifyTitle . ' ' . $crunchifyURL;

What will result in exactly the output contained in your screenshot. 这将导致截屏中包含的输出完全正确。

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

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