2016-08-01 24 views
1

Ich https://github.com/phonegap/phonegap-plugin-barcodescannerPhonegap Barcodescanner Portrait-Modus

mit phonegap Plugin auf QR-Code-Leser einige Tests machen ich den Code in index.js

außer für diesen Abschnitt
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 
    } 
); 

alles scheint funktioniert installiert scheint überhaupt nicht auszulösen. Ich brauche den Scanner im Hochformat, aber immer im Querformat.

{ 
     "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 
    } 

Ich baue die App auf einem Adobe PhoneGap Build und installiert auf Android 6.0.1 Gibt es etwas, was ich verpasst oder etwas falsch gemacht?

Antwort

1

Mein schlechtes ich nicht config.xml aktualisiert hat. offenbar phonegap build verwendet alte Version des Plugins.

benötigt, um diese Linien

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