Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I link to wechat from a webpage?

Whatsapp allows you to link to a new message via

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

How do I do the same thing with WeChat?

like image 472
Rich Avatar asked Feb 16 '16 06:02

Rich


2 Answers

WeChat does have a URI scheme that can be used from a browser. The scheme prefix is weixin://.

There are a few URIs that can be used with this:

weixin://dl/stickers
weixin://dl/settings
weixin://dl/posts
weixin://dl/moments

However, in answer to your question specifically, there is one where you can chat to a contact specifically:

weixin://dl/chat?{toID}

You will need to replace {toID} with whatever the destination user's WeChat ID is.

For reference's sake, these are the URLs that I've found this information from previously:

  • https://www.quora.com/Does-WeChat-support-posting-text-to-chat-via-a-url-scheme-for-mobile
  • https://www.zhihu.com/question/30616809?sort=created (will require translation, unless you are fluent in Chinese)
like image 157
garbetjie Avatar answered Oct 12 '22 13:10

garbetjie


Weixin released an update 6.3.25 on 2016-09-05, which blocks almost all URL schemes request from non-weixin's application. Only requests from weixin's applications and some "white-listed" applications are allowed.

微信在 2016 年 9 月 5 日的 6.3.25 更新中,已经屏蔽了绝大部分外部发起的 URL Scheme 请求,只允许在微信内部或少量白名单应用中进行调用。鉴此,以下所展示的内容目前可能已经失效,本文仅供存档参考。

Translated from a mainland china's developer blog:

Source: https://spacekid.me/weixin-url-schemes/

like image 28
Pang Ho Ming Avatar answered Oct 12 '22 13:10

Pang Ho Ming