Zxing.net.mobile: Latest Version is not Working in Xamarin.Form for iOS

Created on 14 Jun 2017  路  10Comments  路  Source: Redth/ZXing.Net.Mobile

Latest version is not working in the XAMARIN.FORMS project. When Placed barcode in front of the camera then nothing happens. Below is my code :
` var scanPage = new ZXing.Mobile.MobileBarcodeScanner();

        scanPage.TopText = "Place the barcode between the red line";
        scanPage.CameraUnsupportedMessage = "Camera doesnt supports AUTOFOCUS.";
        scanPage.BottomText = "If it it is not scanning, turn FLASH on";
        scanPage.CancelButtonText = "<< Back";
        scanPage.FlashButtonText = "Toggle Flash";
        scanPage.UseCustomOverlay = false;
        scanPage.AutoFocus();
        ZXing.Result result = null;
        result = await scanPage.Scan(new MobileBarcodeScanningOptions
        {
            TryHarder = false,
            AutoRotate = false,
            UseNativeScanning = true,
            PossibleFormats = GetAvailableFormats(),
        });
        if (result != null && !string.IsNullOrWhiteSpace(result.Text))
        {
            await ProcessResult(result.Text);
        }`

The same code is working fine with good scanning speed for Windows and Android.

I have downgraded the version then it starts working but it is takes lot of time to detect the barcode. When I turn Flash on then it detects easily.

What I need to change to make it work in iOS like it is working in other platforms?

Most helpful comment

happening to me as well

correction: it works in landscape mode only

All 10 comments

happening to me as well

correction: it works in landscape mode only

I haven't tried it in landscape mode.

Please post here if you get any solution.

Same problem. It is no longer working in iOS. Page appears but no on scan result.

same issue cant get it to work in Portrait.

the same shit for me with landscape mode only

I have the same issue. I was able to downgrade to 2.1.47 and get it to work. I haven't tested every version in between, so hopefully there's a more recent one that works, but if you're in a rush then hopefully this helps.

Downgrading the 2.1.47 doesn't help. Seems like the owner has abandoned this project since there's no update for months.

Same issue here, I'm using version 2.1.47 which works fine.

I had a similar issue but I was able to fix by setting "IsScanning" and "IsAnalyzing" to true on "OnAppearing()" event on my page (Xamarin Forms project, PCL)

Thanks for reporting this issue! Unforunately it took me way too long to respond 馃槶. Sorry, I apologize! Recently the source code for this project was completely refactored to modernize it. Many PR's were included in this effort, and many bugs were hopefully fixed. Please try out the latest 3.x series of NuGet packages (currently in prerelease). To try and make the project more maintainable in my spare time going forward, I've decided to close all existing issues to start with a clean slate. If you're still experiencing this issue on the newest version, please open a new issue with as much detail as possible. Thank you for your patience and understanding! Happy scanning!

Was this page helpful?
0 / 5 - 0 ratings