zxing QR Scanner not detecting Camera in ios

AMNishanthiKumariAMNishanthiKumari USMember ✭✭✭
edited June 20 in Xamarin.Forms

I have a cross platform project. I need to scan QR code using zxing. I have tried this code. scan page is openinng but camera not detecting in iOS.

This is Main page Code

`using System;
using Xamarin.Forms;
using ZXing.Net.Mobile.Forms;

namespace QRCOdes
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}

    private void Button_Clicked(object sender, EventArgs e)
    {
        var scan = new ZXingScannerPage();
        Navigation.PushAsync(scan);
        scan.OnScanResult += (result) =>
         {
             Device.BeginInvokeOnMainThread(async () =>
             {
                 await Navigation.PopAsync();
                 mycode.Text = result.Text;
             });
         };
    }
}

}
`

Is there anything special to do ios project?

Tagged:

Best Answers

Answers

  • AMNishanthiKumariAMNishanthiKumari USMember ✭✭✭

    @LucasZhang Thank you I added your code to info.plist. But nothing happened. cam screen is white.

  • AMNishanthiKumariAMNishanthiKumari USMember ✭✭✭

    @LucasZhang said:
    Did you add the following code in Appdelegate.cs in iOS project?

    ZXing.Net.Mobile.Forms.iOS.Platform.Init();
    

    Thank you very much i added it. now working fine. (Y)

Sign In or Register to comment.