0

I'm trying to implement sharing to WeChat on our site.

Accordingly to docs, I have to load SDK from http://res.wx.qq.com/open/js/jweixin-1.0.0.js, configure it, and call corresponding methods (onMenuShareAppMessage in my case).

I did all configuration, it seems that it's ok (no errors displayed, wx.ready() callback is executed), but when I call wx methods, nothing happens at all.

Reading SDK code (minified), I can see that everything is wrapped in constructions like window.WeixinJSBridge ? WeixinJSBridge.doSmth() : doNothing(). In my case WeixinJSBridge is undefined.

But what is that WeixinJSBridge and where should I get it? It's not described in docs. Googling it gives some pages on Chinese with same question – "WeixinJSBridge is undefined" and with no answer.

How to properly work with all this stuff? Or, maybe I'm totally misunderstand the docs and sharing to WeChat from website is impossible at all? Please somebody explain.

jeron-diovis
  • 788
  • 1
  • 8
  • 19
  • I would like to suggest you to contact official support. It might sounds oddly but I get a updated documentation from support last time. – Wei Loon Wong Oct 02 '18 at 11:09

2 Answers2

0

Understood. That SDK is only for WeChat browser, built-in inside their mobile application. For other browsers SDK has no sense.

So yep, normally it's impossible to share content to WeChat from website.

jeron-diovis
  • 788
  • 1
  • 8
  • 19
0

WeixinJSBridge is an object available once http://res.wx.qq.com/open/js/jweixin-1.0.0.js is loaded inside the Wechat Web Browser.

It's used specifically to start the payment process in Wechat App.

If you wanna test/debug it, download the wechat testing software for desktop here: https://mp.weixin.qq.com/wiki?action=doc&id=mp1455784140

hiperboreo
  • 245
  • 2
  • 13