Managing Plugins
Learn how to install, add, remove, and search for Awesome Cordova Plugins.
We'll cover the following...
Installing Cordova plugins
Even though we have a basic set of initial plugins already installed, our app would be pretty limited in functionality if we couldn’t add more plugins.
Adding and making a plugin available to our Ionic app requires us to:
- Install the actual plugin itself
- Install an Awesome Cordova Plugins package for that plugin
- Import the Awesome Cordova Plugins package into the project root module and add that to the
providers
array
Let’s see how this works by illustrating how we would install the Google Analytics plugin to an Ionic project:
ionic cordova plugin add cordova-plugin-google-analytics
Followed by the installation of the Awesome Cordova Plugins package for that plugin:
npm install --save @awesome-cordova-plugins/google-analytics
Finally, we will need to install the Awesome Cordova Plugins core package - on a once per project basis:
npm install
...