ionic2 如何引入第三方cordova插件

例如:cordova-plugin-wechat 这个插件能够作微信登陆,分享支付等微信

 

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

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

最后测试

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

结束;能够正常调用里面的方法了。spa

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

相关文章
相关标签/搜索