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.