ionic2 如何引入第三方cordova插件

博主送福利了,微信扫码有惊喜。超值红包等着你。。么么哒

 

言归正转

例如:cordova-plugin-wechat 这个插件可以做微信登录,分享支付等

 

首先第一步:ionic plugin add cordova-plugin-wechat --variable wechatappid= 你的appid

然后引用的时候:首先要在组件里面  declare let Wechat;

最后

Wechat.isInstalled(function (installed) {
      alert("Wechat installed: " + (installed ? "Yes" : "No"));
    }, function (reason) {
      alert("Failed: " + reason);
    });

结束;可以正常调用里面的方法了。

注意:使用该cordova插件时,测试时应该生成正式带签名的包;

posted @ 2016-11-28 11:06  码天码地  阅读(2483)  评论(0编辑  收藏  举报