You can easily create cordova plugin with below configure steps:
Step 1: We need to install plugman to create cordova plugin. Install plugman via below npm command.
Step 2: Then create a new plugin via the following command:
Once done, in the root folder of project there is a new folder generated, whose name is DiyalogChat.
Step 3: I need to develop a plugin used for Android platform, so enable the created plugin with Android platform via command:
Once done, a DiyalogChat.java source file is created, which is used to performing native API call.
Step 4: Perform the following command to generate a descriptor file, package.json for created plugin. Just press enter key again and again to simply use the default value.
Once done, the package.json file is generated within plugin folder
Step 5: Add this plugin to ionic sample application.
Once done, in config.xml in the root folder, our plugin is added.
Now you can use DiyalogChat plugin in another application also, just copy folder DiyalogChat folder from root folder of the project.