9

According to the documentation you can add a project from the registry or from a tarball url?

# add plugin from plugin registry
meteor add cordova:org.apache.cordova.camera@0.3.1

# add plugin from the tarball url
meteor add cordova:com.phonegap.plugins.facebookconnect@https://github.com/Wizcorp/phonegap-facebook-plugin/tarball/0e61babb65bc1716b957b6294c7fdef3ce6ace79

So how do I add this plugin off of github?

Chet
  • 18,421
  • 15
  • 69
  • 113
  • Detailed solution to this question http://stackoverflow.com/questions/26624649/how-to-add-cordova-plug-that-havent-registration-on-plugins-cordova-io – Anubhav Gupta Dec 01 '15 at 05:05

3 Answers3

14

Updated 10/12/2015 for Meteor 1.2.

meteor add cordova:com.verso.cordova.clipboard@https://github.com/VersoSolutions/CordovaClipboard.git#03fe48b62411cbff22229ca13cc3ac8b282f7945

To add to the comment above... to get the @ part.

Before the @: Should be in the plugin.xml in the git repo with the key id.

Next, directly after the @ : https://github.com/VersoSolutions/CordovaClipboard.git

-Get this from the HTTPS link on the right side of the main github repo page.

Next, directly after the #:

-Go to one of the commits in github that you want, the number you need is the last number after 'commit'.

E.G. https://github.com/VersoSolutions/CordovaClipboard/commit/03fe48b62411cbff22229ca13cc3ac8b282f7945

The number would be: 03fe48b62411cbff22229ca13cc3ac8b282f7945 (The commit hash)

Mirrorcell
  • 384
  • 2
  • 10
  • I can not get this to work on Meteor 1.4, with this plugin: https://github.com/Glitchbone/CordovaYoutubeVideoPlayer. I try meteor add com.bunkerpalace.cordova.youtubevideoplayer@https://github.com/Glitchbone/CordovaYoutubeVideoPlayer.git#765b5954e78ecf7950099c10bfe5f81133f8f396 but get "error: Version string must look like semver (eg '1.2.3')" – MastaBaba May 24 '17 at 18:20
  • @MastaBaba Make sure you have cordova: in front. It would be meteor add cordova:com.bunkerpalace.cordova.youtubevideoplayer@github.com/Glitc‌​hbone/.... – Mirrorcell May 25 '17 at 20:01
9

meteor add cordova:com.verso.cordova.clipboard@https://github.com/VersoSolutions/CordovaClipboard/tarball/03fe48b62411cbff22229ca13cc3ac8b282f7945

imslavko
  • 6,596
  • 2
  • 34
  • 43
  • 1
    What was the process you used to answer this question? – ilrein Feb 24 '15 at 17:36
  • Plugin with ADDITIONAL PARAMETERS requires to add those parameters in [MobileConfig](http://stackoverflow.com/questions/26624649/how-to-add-cordova-plug-that-havent-registration-on-plugins-cordova-io/31747292#31747292) file. – Vintesh Jul 31 '15 at 13:26
  • 1
    This approach doesn't appear to be working anymore in 1.2.0.1. I get the error "Meteor no longer supports installing Cordova plugins from arbitrary tarball URLs." I tried using the SHA tag on the URL but then get "fetch failed with status code 406." Any ideas? – occasl Sep 23 '15 at 00:35
4

You can no longer add a Cordova plugin with a tarball URL (I'm using Meteor 1.2.0.1) and there seems to be some sort of bug using the hash value as the docs recommend. Here's what I did instead:

First, I cloned the git project under myapp/private folder. It's important it's private otherwise Meteor will pick-up the www/*.js files and try to compile like normal causing other issues (e.g., "module" or "require" is not defined).

Second, use the following command to add them to your project:

meteor add cordova:com.loutilities.qaps.mobile.plugin.phone@file://./private/plugins/cordova-plugin-phone

This will them to the cordova-plugins directory along with the other bits they add.

occasl
  • 5,303
  • 5
  • 56
  • 81