Search code examples
cordovaangularcordova-pluginsionic2

Access Cordova plugins directly from ionic2 typescript components


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


Solution

  • 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