How do I link to wechat from a webpage?
Asked Answered
C

4

14

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?

Coumarone answered 16/2, 2016 at 6:45 Comment(0)
B
17

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:

Bluing answered 23/2, 2016 at 11:13 Comment(5)
Can you tell me what WeChat ID are you referring to? I am trying to use the weixin://dl/chat deep link, but I can't make it work. I've been trying to put the OpenID and the WeChat ID. Both leave me in the main conversation list. By WeChat ID, I mean the ID you are able to set yourself and by OpenID, I meant the one that is return on the webhook as FromUsername. Looks like this: ogc7Qwpp0cf9ewOJKjpsEhKl_CIX Can't make it work with a regular WeChat user or an official account.Gondolier
Does this still work? for me it only opens up the app and then nothing happens. Only weixin://scanqrcode works and open the QR code reader in wechatGurias
@Gurias I've also had reports from other people that this doesn't work anymore, so you're not the only one. I suspect WeChat may have changed something around this.Bluing
this is not working at all and it's mentioned in one of the links that he has mentioned quora.com/…Inescutcheon
how to link wechat miniprogram from website?Knap
C
16

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/

Clougher answered 23/12, 2016 at 7:31 Comment(0)
K
2

I'm not sure if what you wants to do is to hava a button on your view or web page, where on click it opens wechat and allows users to share the content to other people?

If it is an mobile application, you may want to have a look at wechat's offical api document.
You would first need to do some applications to wechat, then they may give you permission to use this function by providing you with an appId, you utilize this appId and implement interfaces they provide to realize sharing functions.

If you have a wechat offical acount, or you wish to show your web application pages within the browser inside the wechat app (this is my understanding), then you would want to take a look here. You would first have to register an offical account, and bind your application domain in the settings page within the account.

If you have a PC website and wish for users to share certain pages to wechat. what you can do is generate a QR code for that link, thus when users scan the code with wechat's scan function, the link would be opened within the browser inside wechat, and allowing users to use all wechat functions such as sharing.

Kaddish answered 22/2, 2016 at 5:16 Comment(1)
Their JS SDK does not work. It accepts configuration, it can check your API permissions, but calls to any other methods do absolutely nothing. I have no idea why, but it just does not work.Cerium
D
0

When logging into wechat on a PC, you normally load the wechat webpage where there is a QR code. This must be scanned via the wechat client on your mobile phone. The client must be for the user attempting to contact you, it is their PC link to wechat. The user will be presented with their chat window (with their contacts listed). This is a security feature of wechat to ensure registered users only have access to the servers and to slow down trolling. The users mobile phone is the link to the system. When I go to the wechat webpage, I get a qr code and once I have scanned it using my phone app, I get my chat windows with only my contacts. You may be able to add your contact to the list but it still requires the user to have previously registered their mobile phone to the system.

Dikdik answered 10/10, 2016 at 14:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.