到特定whatsapp联系人的网页链接 [英] Web link to specific whatsapp contact
问题描述
我想在网页上放置一个链接,用于打开与某个whatsapp联系人的WhatsApp聊天。换句话说:我想要一个通过whatsapp联系我的链接去到页面的联系我们的facebook / twitter / google + / etc链接旁边。例如:
href =whatsapp:contact=015555555555@s.whatsapp.com& message =我想与您聊天
我有一个优胜者(参见测试3),这里是每一个的结果:
(我认为测试3也适用于你是因为如果访问你的网站的人没有你的联系人列表,那么这是唯一的选择)。
在所有测试中,数字必须例如:
- +55(011)99999-9999(NOT) li>
- +5511999999999(YES)
在测试1和2上,它只能用加号测试1:
< a href =whatsapp:// send?abid = phonenumber& text = Hello%2C%20World!>发送消息< / a>
这样,您的联系人列表中必须包含电话号码。它不适合我,因为我希望能够发送消息给我的联系人列表中可能没有的号码。
如果您不在你的联系人列表中有号码,它会打开Whatsapp列出所有注册联系人,所以你可以选择一个。
这是一个很好的分享内容的选项。
测试2:
< a href =intent:// send /phonenumber#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end\">发送消息< / a>
此方法仅适用于Android 和联系人列表。如果你没有它,Android会打开你的短信应用程序,所以你可以邀请联系人使用Whatsapp。
测试3 (赢家) strong>:
< a href =https://api.whatsapp.com/send?phone=15551234567> ;发送消息< / a>
这是完全为我工作的唯一方法。
值得注意:
- 我必须将我的Whatsapp更新至最新版本
- 号码的国家代码不得有领先加上
- 更多详细信息,请访问: https ://www.whatsapp.com/faq/en/general/26000030
I'd like to place a link on a webpage which opens a whatsapp chat with a certain whatsapp contact. In other words: I want a "contact me by whatsapp" link to go next to the page's "Contact us my facebook/twitter/google+/etc" links. Something like:
href="whatsapp:contact=015555555555@s.whatsapp.com&message="I'd like to chat with you"
I've tried many approaches and I have a winner (see Test 3), here is the result of each one:
(I think the Test 3 will also work for you because if the person visiting your site doesn't have you on their contact list, it's the only option that will allow it.)
In all tests the number had to be complete, with country and location code without any initial zeros. Example:
- +55(011) 99999-9999 (NOT)
- +5511999999999 (YES)
On tests 1 and 2 it only worked with a plus sign on country code: +5511999999999
Test 1:
<a href="whatsapp://send?abid=phonenumber&text=Hello%2C%20World!">Send Message</a>
This way you must have the phonenumber on your contact list. It doesn't worked for me because I wanted to be able to send a message to a number which I may not have on my contact list.
If you don't have the number on your contact list, it opens the Whatsapp listing all your registered contacts, so you can choose one.
It's a good option for sharing stuffs.
Test 2:
<a href="intent://send/phonenumber#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end">Send Message</a>
This approach only works on Android AND if you have the number on your contact list. If you don't have it, Android opens your SMS app, so you can invite the contact to use Whatsapp.
Test 3 (The Winner):
<a href="https://api.whatsapp.com/send?phone=15551234567">Send Message</a>
This was the only way that fully work for me.
- It works on Android, IOS AND Web App on desktop,
- You can start a conversation with a number that you don't have on your contact list
Worth notice:
- I had to update my Whatsapp to latest version
- The number's country code must not have a leading plus
- More details here: https://www.whatsapp.com/faq/en/general/26000030
这篇关于到特定whatsapp联系人的网页链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!