cordova-plugin-wechat在github的地址:
https://github.com/xu-li/cordova-plugin-wechat
主要常用功能:
检查是否安装微信
(<any>window).Wechat.isInstalled(installed => {
if (installed) {
// todo when installed
} else {
// todo when uninstalled
}
}, reason => {
// todo when uninstalled
});
检查是否安装微信+微信授权
(<any>window).Wechat.isInstalled(function (installed) {
if(installed){
var scope = "snsapi_userinfo",
state = "_" + (+new Date());
(<any>window).Wechat.auth(scope, state, function (response) {
// auth success with response
}, function (reason) {
// auth failed with reason
});
}else{
// to