简体   繁体   English

通过HTML共享whatsapp联系人

[英]Share a whatsapp contact over HTML

I would like to create an HTML link so that anyone could easily find me on whatsapp. 我想创建一个HTML链接,以便任何人都可以在whatsapp上轻松找到我。 There is URL Schema that whatsapp provides but there is no way I found on the documentation to share a contact. whatsapp提供了URL架构,但是在文档中找不到共享联系人的方式。 The only functionality the schema handles is that of sending a message and optionally include an user ID from the existing library. 模式处理的唯一功能是发送消息的功能,并且可以选择包括现有库中的用户ID。

How would you address this problem? 您将如何解决这个问题? Is there any way to create a contact in the phonebook using HTML? 有什么方法可以使用HTML在电话簿中创建联系人? That will also work. 那也可以。

The closest thing I have found is the html "tel" tag, but that may launch other applications other than the contact list to add a new contact. 我找到的最接近的东西是html“ tel”标记,但这可能会启动联系人列表以外的其他应用程序以添加新联系人。

I found a solution for this issue. 我找到了解决此问题的方法。 It is not perfect, but its the best approach. 它不是完美的,但是是最好的方法。

Currently the whatsapp protocol does have any features for creating new contacts, but it does have one to send a message to one of your existing contacts/chats. 当前,whatsapp协议确实具有创建新联系人的任何功能,但是它确实具有向您现有的联系人/聊天之一发送消息的功能。 So what I did is to share a message with my contacts details. 因此,我要做的是与我的联系人详细信息共享一条消息。

whatsapp://send?text=join%20me%20on%20TELEPHONE_NUMBER_HERE%20%3A)

This will open the whatsapp app an the user will see: 这将打开whatsapp应用,用户将看到:

join me on TELEPHONE_NUMBER :)

It is not a perfect solution but is something if you want to add a whatsapp link in your site. 这不是一个完美的解决方案,但是如果您想在网站中添加whatsapp链接,则可以解决。

Hope it helps. 希望能帮助到你。

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

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