Android Phonegap条形码扫描仪纵向模式
我正在用phonegap插件对二维码阅读器进行测试 我将代码安装到index.js中Android Phonegap条形码扫描仪纵向模式,android,cordova,cordova-plugins,barcode-scanner,Android,Cordova,Cordova Plugins,Barcode Scanner,我正在用phonegap插件对二维码阅读器进行测试 我将代码安装到index.js中 cordova.plugins.barcodeScanner.scan( function (result) { alert("We got a barcode not \n" + "Result: " + result.text + "\n" + "Format: " + result.format + "\n" + "
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
}
);
除了这一部分,一切似乎都正常,似乎根本没有触发。
我需要扫描仪是纵向的,但它总是在横向模式
{
"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
}
我在AdobePhoneGap上构建应用程序,并安装在Android 6.0.1上
我有什么遗漏或做错的吗?我的错
我没有更新config.xml。
显然,phonegap构建使用的是旧版本的插件
需要这条线吗
<plugin spec="https://github.com/phonegap/phonegap-plugin-barcodescanner#6.0.1" />
<preference name="android-build-tool" value="gradle" />