2016-08-01 18 views
1

私はPhoneGapのプラグイン https://github.com/phonegap/phonegap-plugin-barcodescannerPhoneGapのバーコードスキャナのポートレートモード

にQRコードリーダーでいくつかのテストをやってる私は

cordova.plugins.barcodeScanner.scan(
    function (result) { 
     alert("We got a barcode not \n" + 
      "Result: " + result.text + "\n" + 
      "Format: " + result.format + "\n" + 
      "Cancelled: " + result.cancelled); 
    }, 
    function (error) { 
     alert("Scanning failed: " + error); 
    }, 
    { 
     "preferFrontCamera" : true, // iOS and Android 
     "showFlipCameraButton" : true, // iOS and Android 
     "prompt" : "Place a barcode inside the scan area", // supported on Android only 
     "formats" : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED 
     "orientation" : "portrait" // Android only (portrait|landscape), default unset so it rotates with the device 
    } 
); 

すべては、このセクションを除いて取り組んでいるようだindex.jsにしてコードを設置、まったくトリガーしていないようです。 私はスキャナーを肖像画にする必要がありますが、常に横長モードです。

{ 
     "preferFrontCamera" : true, // iOS and Android 
     "showFlipCameraButton" : true, // iOS and Android 
     "prompt" : "Place a barcode inside the scan area", // supported on Android only 
     "formats" : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED 
     "orientation" : "portrait" // Android only (portrait|landscape), default unset so it rotates with the device 
    } 

私は、AdobeのPhoneGapのビルドでアプリを構築し、アンドロイド6.0.1 にインストールされているが、私は間違って何かを逃したか、行って何がありますか?

答えて

1

私の悪い 私はconfig.xmlを更新しませんでした。明らかにphonegapのビルドはプラグインの古いバージョンを使用していた。 このライン

<plugin spec="https://github.com/phonegap/phonegap-plugin-barcodescanner#6.0.1" /> 
<preference name="android-build-tool" value="gradle" /> 
必要

関連する問題