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

前端 未结 4 1478
感情败类
感情败类 2021-01-14 06:42

like these plugin

https://github.com/ArchieGoodwin/SilentShot

https://github.com/alongubkin/phonertc

they don\'t have a tarball url

c         


        
相关标签:
4条回答
  • 2021-01-14 07:29

    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
    
    0 讨论(0)
  • 2021-01-14 07:31

    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
    
    0 讨论(0)
  • 2021-01-14 07:39

    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

    0 讨论(0)
  • 2021-01-14 07:44

    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.

    0 讨论(0)
提交回复
热议问题