Here the so-called micro-letter public account of the random spread, refers to your micro-letter public number to spread to micro-trust friends, micro-trust friend Circle, after the friend point in the shortest possible way to pay attention to the success of your micro-letter public number! If your article was pushed through a micro-trust public platform, go in, You will find that the public number nickname is clickable and can directly open the public data page. We might as well take a look at its source code:
HTML code:
Baidufe
JavaScript code:
function Viewprofile () {
if (typeof Weixinjsbridge!= "undefined" && weixinjsbridge.invoke) {
Weixinjsbridge.invoke (' profile ', {
' username ': ' gh_dd4b2c2ada8b ',/* Your public number original ID * *
' Scene ': ' 57 '
});
}
}
You might be happy to think that this code works!
In fact, this code is in effect, there are restrictive conditions: The IOS environment, only in the Mp.weixin.qq.com domain entry into force!
Of course, you can suspect that we can then make a simple change to the JavaScript code above to see what information is available in the callback:
function Viewprofile () {
if (typeof Weixinjsbridge!= "undefined" && weixinjsbridge.invoke) {
Weixinjsbridge.invoke (' profile ', {
' username ': ' gh_dd4b2c2ada8b ',/* Your public number original ID * *
' Scene ': ' 57 '
},function (RESP) {
alert (resp.err_msg); /* Here, we put the err_msg output * *
});
}
}
We deploy the code to our own Web server, such as: http://www.baidufe.com/demo/wxid_test.html, then open the link in a micro-mail built-in browser, and click a tag defined in HTML. Call the Viewprofile method, and the "Not_allow" error message will pop up!
How can this situation be broken? Is it true that there is no way to spread the public number on its own page?
In fact, we can go around this way:
1, through the micro-trust public platform to push the background of the simplest message, this will generate a separate page, the page can be directly clicked on the nickname Open Public data page, such as this demo independent page
2. On our own page, add a link to the standalone page generated above
Separate pages are similar:
Of course, the above discussion is all about the iphone version of the micro-letter, indeed, the micro-credit iOS webview than the Android WebView do a lot of restrictions.
Next, let's look at how the Android & WP public number is being promoted.
In fact it is very simple (written in my previous blog), is a link to fix:
Click here to add Baidufe public number
Above, you can complete the free spread of the public account on your page!