Cordova's main purpose is to package web code into a Native App, but the second most important job is to create a bridge between the web(JS) code and the native code. Cordova ensures that Hybrid Apps harness the power and performance of native code perfectly. Cordova plugins utilize this power and enable us to use the specific device features in JS easily.
Cordova from version 3 and above decided to expose all device APIs as plugins. The Cordova plugin is a reusable set of code that contains the native code as well as JavaScript code. We know that our web app runs inside a WebView control in Ionic/Cordova Apps. The JavaScript code of the plugin exposes methods that will call a bridge/interface to invoke a native method for the respective platform such as iOS(Objective C) and Android(Java).
The contents of a Cordova plugin package are:
Native code for each platform
A common JavaScript library
A manifest file called
plugin.xml
The folder structure for the Cordova...