Publishing our plugin to Cordova Registry

After completing our plugin implementation, we can publish our SMS plugin to the Apache Cordova Registry. Before publishing our custom SMS plugin, let's revise our final SMS plugin structure. The following screenshot shows the final structure of our custom SMS plugin:

Publishing our plugin to Cordova Registry

Hierarchy of our final plugin structure

As shown in the preceding screenshot, the final structure has the following main additions:

  • A new wp8 directory under the src directory; it has our wp8 plugin implementation
  • A markdown README.md file that explains the purpose of the plugin and an example of its usage

Now, after understanding the final structure of our custom SMS plugin, we can now publish our plugin to the Apache Cordova Registry. In order to do this, just execute the following plugman publish command specifying our SMS plugin directory:

> plugman publish sms

After executing this command successfully, you will be notified that our [email protected] plugin has been published successfully.

By uploading our custom plugin to the Apache Cordova Registry, the Apache Cordova community can now use our plugin by just using the normal Cordova CLI's plugin add command as follows:

> cordova plugin add com.jsmobile.plugins.sms

In order to make the source code of our plugin accessible, we published its source code on GitHub, and it can be downloaded from https://github.com/hazems/cordova-sms-plugin.

Publishing our custom plugin to GitHub gives our plugin consumers the ability to add our custom plugin to their projects by specifying the plugin GitHub URL as follows:

> cordova plugin add https://github.com/hazems/cordova-sms-plugin.git

In the next section, we will create our test Cordova application, which will test the functionality of our plugin across the different platforms (Android, iOS, and wp8).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.48.204