How to add cordova plugin manually to Ionic Project


#1

Hello Ionic masters,

I have problem with adding cordova plogin to Ionic v1 app manually.
I have our new company cordova plugin for authentification but I have folders and scripts with plugin.

Every time if I use some plugin from Cordova I use cordova plugin add … “name of plugin” in cli and install it.
But now I don’t know how I use plugin if I only add folder with plugin to Ionic folder plugins path:“appName/plugins/cordova-plugin”.

So Is it enough if I add “” to index.html and use methods in auth.js?? but how I create dependency in controller for use methods?

Could somebody help me please?

PS: It is old app in Ionic v1, until now I download data normally by $http, but now I must use authentification for connection, so a need use corporate cordova plugin.

Best regards, Petr


#2

cordova plugin add can also take a local directory with a plugin.xml file inside as a parameter. This should install the plugin normally. See the “Examples” headline here: https://cordova.apache.org/docs/en/latest/reference/cordova-cli/#cordova-plugin-command (scroll down a bit)