我正在开发一个需要二维码扫描的 Buildfire 插件。我使用了下面的代码,它可以在预览器应用程序中运行,但无法扫描 Play 商店中的内置应用程序(仅在 Android 上测试)。
function scan(){
buildfire.services.camera.barcodeScanner.scan(
{
preferFrontCamera : false,
showFlipCameraButton : true,
formats : "QR_CODE", // default: all but PDF_417 and RSS_EXPANDED
},
function (err, result) {
buildfire.notifications.alert("We got a barcode\n" +
"Result: " + result.text + "\n" +
"Format: " + result.format + "\n" +
"Cancelled: " + result.cancelled);
rcpt = result.text;
console.log(rcpt);
document.getElementById("recipient").value = rcpt;
}
);
}
带按钮的启动功能。在预览器中工作。内置(android)应用程序失败