How can I make a wrapper of cordova plugin which is not supported in Native plugins?


#1

Hi
I want to use cordova-plugin-wechat in Ionic3.
I had no problem on Ionic1, but I’m not sure how to use it in Ionic3.
Can’t we use cordova plugins else ones supported in Ionic native plugins?
I think that there must be a way to make a wrapper of Cordova plugin.
Please give me advice.


#2

Haven’t tried using this particular plugin but using the window variable should be able to find it.

window[‘Wechat’]


#3

Look at how Ionic Native does it with any plugin, do it the same way. Install in your project, done.


#4

I tried to follow @ionic-native/alipay, but couldn’t get it.
There is a main file index.js. But it’s different from modules I have ever seen.


#5

Someone suggested to me use ‘declare var Wechat:any;’ like importing jquery.
But I’m not sure it will work.