Access Cordova plugins directly from ionic2 typescript components

心已入冬 提交于 2019-12-12 17:51:37

问题


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



来源:https://stackoverflow.com/questions/39532737/access-cordova-plugins-directly-from-ionic2-typescript-components

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!