Skip to content

Instantly share code, notes, and snippets.

@samma835
Created December 1, 2012 00:26
Show Gist options
  • Save samma835/4179745 to your computer and use it in GitHub Desktop.
Save samma835/4179745 to your computer and use it in GitHub Desktop.
微信恶俗关注
var addWxContact = function(wxid, cb)
{
if (typeof WeixinJSBridge == 'undefined') return false;
WeixinJSBridge.invoke('addContact', {
webtype: '1',
username: wxid
}, function(d) {
// 返回d.err_msg取值,d还有一个属性是err_desc
// add_contact:cancel 用户取消
// add_contact:fail 关注失败
// add_contact:ok 关注成功
// add_contact:added 已经关注
WeixinJSBridge.log(d.err_msg);
cb && cb(d.err_msg);
});
};
@liubiqu
Copy link

liubiqu commented Jun 19, 2014

这个已经不能使用了吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment