Skip to content

"Barcode Found" but result handler not called #934

@ghost

Description

Hello, I'm using the following code to scan for a QR code, apparently the scanning works because when pointing the camera to a QR code [ZXing.Net.Mobile] Barcode Found is logged from ZXing, however my defined HandleScanResult function is not called, am I registering the callback wrong?

        void scan()
        {
            var opts = new MobileBarcodeScanningOptions
            {
                PossibleFormats = new List<ZXing.BarcodeFormat> {
                    ZXing.BarcodeFormat.DATA_MATRIX,
                    ZXing.BarcodeFormat.QR_CODE
                },
                CameraResolutionSelector = availableResolutions => {

                    foreach (var ar in availableResolutions)
                    {
                        Console.WriteLine("Resolution: " + ar.Width + "x" + ar.Height);
                    }
                    return null;
                }
            };

            scanFragment.StartScanning(HandleScanResult, opts);

        }

        private void HandleScanResult(ZXing.Result obj)
        {
            if (obj.Text.IsNullOrEmpty()) //BREAKPOINT HERE, NEVER REACHED
            {
                return;
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions