crapthings
crapthings

Reputation: 2485

How to add cordova plug that haven't registration on plugins.cordova.io?

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

Upvotes: 3

Views: 2198

Answers (4)

insaneinc
insaneinc

Reputation: 260

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

Upvotes: 10

Christian Fritz
Christian Fritz

Reputation: 21374

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

Upvotes: 0

Vintesh
Vintesh

Reputation: 1697

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.

Upvotes: 0

DATEx2
DATEx2

Reputation: 3503

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/[email protected]

outputs:

added cordova plugin https://github.com/EddyVer

Upvotes: 0

Related Questions