Managing Plugins
Explore how to manage plugins in Ionic applications using Cordova. Understand the process of installing plugins, integrating them with Awesome Cordova Plugins packages, importing into your Angular project, and removing plugins when no longer needed. This lesson equips you with practical skills to extend app capabilities with native features.
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
providersarray
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
...