How to install and remove a local cordova plugin in ionic 3

Install cordova plugin in ionic app

ionic cordova plugin add src/shared/plugins/torovinsquareup

Uninstall cordova plugin in ionic app

List all installed plugins:

cordova plugin list

# output
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-torovinsquareup 0.0.1 "torovinsquareup"
...........
........

How to use this plugin

Note: Sometimes this method may not work for some plugin. I create this plugin with plugman, and this method works.

Add declare let cordova: any; in .ts file.

cordova.plugins.torovinsquareup.coolMethod(amount_cent, 
      (res) => {
        this.toastCtrl.create({ message: JSON.stringify(res), duration: 3000 }).present();
      }, 
      (err) => {
        this.toastCtrl.create({ message: JSON.stringify(err), duration: 3000 }).present();
      }
    );
Uninstall plugin:

ionic cordova plugin rm cordova-plugin-torovinsquareup

Topic: