3

like these plugin

https://github.com/ArchieGoodwin/SilentShot

https://github.com/alongubkin/phonertc

they don't have a tarball url

cordova plugin add https://github.com/alongubkin/phonertc.git

how do i add plugin like this ?

meteor add cordova:@https://github.com/alongubkin/phonertc.git
crapthings
  • 2,485
  • 3
  • 20
  • 33

4 Answers4

10

Update
This works in Meteor 1.2 and 1.3-beta:
meteor add cordova:pluginID@gitUrl#commithash

So for the actionsheet plugin:
meteor add cordova:cordova-plugin-actionsheet@https://github.com/EddyVerbruggen/cordova-plugin-actionsheet.git#b93aef15ce4d70c3f9ddf3e4413e68e2ff0c4811

You could also simply copy that line in .meteor/cordova-plugins file without the 'meteor add cordova' prefix and re-run for ios/android.


Original answer
For adding 3rd party cordova plugins to meteor which are not in the plugins.cordova.io registry yet, the below method should always work: For example, to add https://github.com/EddyVerbruggen/cordova-plugin-actionsheet

(breaking it down)

  • meteor add cordova:
  • nl.x-services.plugins.actionsheet (take this id from the plugin.xml file in github)
  • @https://github.com/EddyVerbruggen/cordova-plugin-actionsheet (git repo)
  • /tarball (just the keyword)
  • /62536f9ee22bfbb8a22ae364d2aaa58bd38e5eb0 (get this from the little "Copy SHA" icon next to latest commit at the top in github)

So the complete line here:

meteor add cordova:nl.x-services.plugins.actionsheet@https://github.com/EddyVerbruggen/cordova-plugin-actionsheet/tarball/62536f9ee22bfbb8a22ae364d2aaa58bd38e5eb0

For adding plugin: https://github.com/ArchieGoodwin/SilentShot

meteor add cordova:biz.incoding.silentshot@https://github.com/ArchieGoodwin/SilentShot/tarball/d123cd881bb211d89c6402d317bfdd3b6302d66b

insaneinc
  • 260
  • 1
  • 12
  • How do you specify sub-folders? – DATEx2 Apr 03 '15 at 02:06
  • Attempting to add the branch.io Cordova plugin, we've tried the following command : meteor add cordova:io.kakaka.branch.sdk@https://github.com/BranchMetrics/tarball/a30665d8b12896d1aad9ee0beb42c516e5fc1f6c ... which pretends to add the plugin, but then, debugging the code, we see no changes. What are we doing wrong here? – Marc Mar 10 '16 at 10:57
  • Marc, did you try adding it the usual way first? `meteor add cordova:branch-cordova-sdk@2.0.2`? Looks like it adds the plugin, but you'll have to set the BRANCH_LIVE_KEY manually in mobile-config.js or config.xml (I did not try this). Also, please see if it reflects in .meteor/cordova-plugins file. – insaneinc Mar 10 '16 at 15:44
0

You're almost there. You can't target a repo directly but you can target one if its releases:

e.g. For me this worked:

meteor add cordova:https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin/archive/2.0.1.tar.gz@2.0.1

outputs:

added cordova plugin https://github.com/EddyVer
DATEx2
  • 3,585
  • 1
  • 24
  • 26
0

For the plugin which requires additional parameters then - follow instructions here.

You need to provide your variables in key-val pair in Mobile Config File as described here.

Vintesh
  • 1,657
  • 1
  • 24
  • 31
0

Since I found it tedious to always look up the right package name and commit hash, and type in the tarball url, I created a little script, available as a gist, that uses bash and node to simplify this task a little:

./meteor_add_cordova.sh https://github.com/cordova-sms/cordova-sms-plugin
Christian Fritz
  • 20,641
  • 3
  • 42
  • 71