Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scanning QR Codes does not work #1055

Open
dimeom opened this issue Sep 20, 2022 · 0 comments
Open

Scanning QR Codes does not work #1055

dimeom opened this issue Sep 20, 2022 · 0 comments

Comments

@dimeom
Copy link

dimeom commented Sep 20, 2022

Hi there.

I have been trying to scan a qrcode on xamarin forms for ios but it has not worked yet :(

I am using Microsoft Visual Studio 2022, Xamarin.iOS and Xamarin.Mac SDK 15.12.0.2 and the latest version of ZXing.Net.Mobile (even the 2.3.1 and 2.2.9)

When I try to scan a qrcode, the camera opens and ask for permissions. After allowing it, the camera just stays open trying to scan the code, but nothings happens.

This is how I am trying:

        var lOptions = new ZXing.Mobile.MobileBarcodeScanningOptions();
        lOptions.PossibleFormats = new List<ZXing.BarcodeFormat>() {
            ZXing.BarcodeFormat.QR_CODE
            };
        lOptions.TryHarder = true;
        lOptions.CharacterSet = "utf-8";


        lOptions.AutoRotate = true;
        lOptions.TryInverted = true;
        lOptions.UseNativeScanning = true;

        var lScanner = new ZXing.Mobile.MobileBarcodeScanner();
        await Task.Delay(500);
        var lResult = await lScanner.Scan();

and I initialize Zxing on the FinishLaunching().. in the AppDelegate.cs from the iOS project like this -> ZXing.Net.Mobile.Forms.iOS.Platform.Init();

I have also added the camera permissions to the info.plist
NSCameraUsageDescription
Please allow access to the camera to scan QR codes.

As a last try, I have also tried the ZXing.Net nuget, but that does not work either.

what am I doing wrong?

Could you please help me out?

Thanks in advance,

Antonio

@dimeom dimeom changed the title Scanning QR Codes dies not work Scanning QR Codes does not work Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant