weixin_39562197
2021-01-01 06:58Barcode Scanner not reading Barcode
We are currently experience an issue where the Barcode isn't actually scanned. The scanner seems not to detect the barcode. I've debugged the code up to
static Future<scanresult> _doScan(ScanOptions options) async {
var config = proto.Configuration()
..useCamera = options.useCamera
..restrictFormat.addAll(options.restrictFormat)
..autoEnableFlash = options.autoEnableFlash
..strings.addAll(options.strings)
..android = (proto.AndroidConfiguration()
..useAutoFocus = options.android.useAutoFocus
..aspectTolerance = options.android.aspectTolerance
/**/)
/**/;
var buffer = await _channel.invokeMethod('scan', config?.writeToBuffer());
var tmpResult = proto.ScanResult.fromBuffer(buffer);
return ScanResult(
format: tmpResult.format,
formatNote: tmpResult.formatNote,
rawContent: tmpResult.rawContent,
type: tmpResult.type,
);
}
</scanresult>
useCamera=-1 unless I force it in the options:
int numberOfCameras = await BarcodeScanner.numberOfCameras;
var options = ScanOptions(
useCamera: numberOfCameras-2
);
I don't know if it is part of the issue.
My config is as follows:
- barcode_scan version 3.0.0
-
Flutter 1.12.13+hotfix.9 • channel stable • https://github.com/flutter/flutter.git Framework • revision f139b11009 (3 weeks ago) • 2020-03-30 13:57:30 -0700 Engine • revision af51afceb8 Tools • Dart 2.7.2
-
We are building for iOS 13.2.
-
Test phones is iPhone 8 and iPhone X with latest iOS version.
-
It currently works flawlessly on our Android builds though *I've added the Privacy Permission for iOS
<dict>
<!-- ... -->
<key>NSCameraUsageDescription</key>
<string>Camera permission is required for barcode scanning.</string>
<!-- ... -->
</dict>
- I've also added an example of a barcode we are trying to scan.
Please inform me if I'm doing something stupid.
该提问来源于开源项目:mintware-de/flutter_barcode_reader
- 点赞
- 回答
- 收藏
- 复制链接分享
18条回答
为你推荐
- 2D矩阵条形码在cakephp中的tcpdf供应商中为动态字符串生成错误的条形码
- barcode
- tcpdf
- php
- 1个回答
- 扫描条形码 - 在SQL数据库中保存代码[重复]
- barcode
- mysql
- php
- 1个回答
- NSData(if语句)
- ios
- nsurl
- if-statement
- php
- nsdata
- 2个回答
- 条码图像的PHP查询结果
- barcode
- header
- arrays
- php
- 1个回答
- php image保存到目录并保存为pdf
- image-processing
- pdf-generation
- php
- 1个回答