Posts

Showing posts with the label cordova-plugin

Creating a cordova plugin and using it with ionic

In this article I will show how you can create a cordova plugin and use it in an ionic project. Prerequisites Before you can start you need to install the following tools. Node 6 LTS NPM 3+ Creating a cordova plugin Initialising the plugin To create the project files for the cordova plugin you can use use plugman which is a nice cli. I was using version 2.0.0. > npm install -g plugman ... > plugman --version 2.0.0 > plugman create ^     --name PingPong ^     --plugin_id cordova-plugin-pingpong ^     --plugin_version 0.0.1 > cd .\PingPong `plugman create` will create the following file/folder structure. PingPong   src                             <- Folder for native code   www                          <- Folder for JavaScript API which calls native code     PingPong.js                          <- Public API    plugin.xml                 <- Plugin configuration file The next step is to add the platforms y