Slide 14
Slide 14 text
In-Browser
IF
a. page runs inside the WeChat browser
b. page runs from an authorised domain
c. page provide valid auth token/signature
THEN
page can use the WeChat JS API (via
wx./jWeixin. object)
When the page opens, you have to wait for the browser to call:
wx.ready(function(){ // ... });
then you can start making calls to the WeChat JS API.
wx.checkJsApi({
jsApiList: ['chooseImage'] // List of JS APIs to be checked.
success: function(res) {
// Key-value pairs, false for unavailable APIs
// Example:
// { "checkResult": {"chooseImage":true},
// "errMsg":"checkJsApi:ok" }
});
Each API calls, as a result of its invocation, some callbacks:
● success: ok
● fail: ko
● complete: called no matter what
Some API have also:
● cancel: if the API displays an UI with buttons and the user tap cancel
● trigger: called when some menu items are clicked