I have setup the android project using cordova command-line-interface with the help of node.js. I have added the required plugin from Github to our project by the following command:
C:Users/Admin/>cordova plugin add https://github.com/phonegap-build/PushPlugin.git
For now it is working fine, but what if they suddenly changes the plugin.So I want to stick with the specific revision of plugin. So how can i get the plugin which is specific to particular revision. Shall i add the revision number or commit number to the above url?
A plugin is a package of injected code that allows the Cordova webview within which the app renders to communicate with the native platform on which it runs. Plugins provide access to device and platform functionality that is ordinarily unavailable to web-based apps.
A Cordova plugin provides a JavaScript interface to the native components. These plugins consist of various elements that are as follows: Common JavaScript Interface. A manifest file, i.e., xml.
So, you must install your application on a device to use any off-platform Cordova plugins. To do so, navigate to the Development tab and switch from DEVELOPMENT to the NATIVE PLATFORMS section under your mobile project module. Then click GENERATE ANDROID APP.
I got the answer finally, I could get the plugin code upto particular commit:
The following command is what I used to get the latest plugin code:
D:sampleproject/> cordova plugin add https://github.com/phonegap-build/PushPlugin#2345fd8fe48572eae3df631cf8fb262ef2804779
I don't know a way to stick to a particular revision (other than cloning it first and after the clone add it with a file path) but I know it is possible to install from a specific git tag which might be sufficient in most cases.
Command to install from a specific git tag
cordova plugin add https://github.com/phonegap-build/PushPlugin.git#1.3.4
If you want to install from a tag and a specified sub directory (maybe because plugin.xml isn't a top-level file) you can install it with this command: cordova plugin add https://github.com/phonegap-build/PushPlugin.git#1.3.4:/plugin/sub/dir
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With