Access Cordova plugins directly from ionic2 typesc

2019-07-21 12:33发布

问题:

I am creating new Ionic2 typescript application. Few of the required native access plugins are not available in ionic native till now(Routed device check plugin, Read SMS plugins etc). So i required to use cordova plugins directly with out intervention of ionic native class and injection formalities. your suggestions are appreciable. thanks

回答1:

There is absolutely nothing to stop you from using these plugins. Just tell typescript that they exist like so:

declare var rootdetection:any; 

If you want to be proficient about it, writing your typing(an interface with all the plugins functionality) for the plugin and add it to your project