How to add a cordova plugin to meteor that isn't in the phonegap registry?

戏子无情 提交于 2019-12-20 23:30:06

问题


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?


回答1:


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




回答2:


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)




回答3:


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.



来源:https://stackoverflow.com/questions/26068852/how-to-add-a-cordova-plugin-to-meteor-that-isnt-in-the-phonegap-registry

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!