Cordova-plugin-barcodescanner 扫描选项在 PhoneGap 移动应用程序中工作,并在构建后



我想使用 cordova-plugin-barcodescanner 插件使用前置摄像头扫描二维码。我正在使用phonegap,当我使用phonegap移动应用程序测试应用程序时,一切正常。当我构建apk文件并在我的安卓设备上运行构建的应用程序时,它开始使用后置摄像头。更重要的是,没有一个选项被尊重,没有翻转相机的选项,没有闪光灯等......关于如何解决此问题并使选项起作用的任何想法?谢谢。

function QRScan(){
    cordova.plugins.barcodeScanner.scan(
        function (result) {
            alert("We got a barcoden" +
                  "Result: " + result.text + "n" +
                  "Format: " + result.format + "n" +
                  "Cancelled: " + result.cancelled);
            document.getElementById('cryptoId').value = result.text
        },
        function (error) {
            alert("Scanning failed: " + error);
        },
        {
            preferFrontCamera : true, // iOS and Android
            showFlipCameraButton : true, // iOS and Android
            showTorchButton : true, // iOS and Android
            torchOn: true, // Android, launch with the torch switched on (if available)
            saveHistory: true, // Android, save scan history (default false)
            prompt : "Place a barcode inside the scan area", // Android
            resultDisplayDuration: 500, // Android, display scanned text for X ms. 0 suppresses it entirely, default 1500
            formats : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED
            orientation : "landscape", // Android only (portrait|landscape), default unset so it rotates with the device
            disableAnimations : true, // iOS
            disableSuccessBeep: false // iOS and Android
        }
     );
}

似乎您已经安装了cordova-plugin-barcodescanner,并且您正在使用的选项来自phonegap-plugin-barcodescanner...

相关内容

最新更新