Phonegap 3.0.0: BarcodeScanner Plugin

前端 未结 5 1173
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-08 08:39

currently I\'m trying to install the BarcodeScanner Plugin for Phonegap Version 3.0.0. I can\'t find any working documentation on how to install it correctly an

5条回答
  •  孤城傲影
    2020-12-08 09:08

    Here is my explanation based on Jonathan solutions. I tried his solution and succeeded but took more time. So I thought to explain steps I followed so that it can save someone's time.

    Steps:-

    1) First install cordova if not already installed using Cordova cli as below

    Note: you must install node.js if not already installed.

    npm install -g cordova
    or
    sudo npm install -g cordova

    2) Go to the directory where you maintain your source code, and run a command such as the following:

  • $ cordova create hello com.example.hello HelloWorld

    The first argument specifies a hello directory to be generated for your project. Its www subdirectory houses your application's home page, along with various resources under css, js, and img, which follow common web development file-naming conventions. The config.xml file contains important metadata needed to generate and distribute the application.

    The other two arguments are optional: the com.example.hello argument provides your project with a reverse domain-style identifier, and the HelloWorld provides the application's display text

  • cd hello
  • cordova platform add ios
  • cordova plugin add https://github.com/jonathannaguin/BarcodeScanner.git
  • cordova build
  • cordova prepare

    3) remove all files from www folder except following

  • confix.xml
  • cordova_plugins.js
  • cordova.js
  • plugins (folder contaning barcodescanner.js)

    and your own index.html,js,css files

    I will be glad if it helps someone.

提交回复
热议问题