title: ZXing barcode scanner in Xamarin Forms on iOS doesn't read barcodes
body: <p>I'm working on a Xamarin Forms PCL project targeting Android and iOS that needs some basic barcode scanning functionality.</p>
  
  <p>I got things up and running with the forms version of the <a href="https://github.com/Redth/ZXing.Net.Mobile" rel="nofollow noreferrer">ZXing.Net.Mobile</a> package following <a href="https://blog.xamarin.com/barcode-scanning-made-easy-with-zxing-net-for-xamarin-forms/" rel="nofollow noreferrer">this tutorial</a> and referencing <a href="https://components.xamarin.com/gettingstarted/zxing.net.mobile.forms" rel="nofollow noreferrer">this guide</a> and it works great on Android. However, on iOS the camera comes up but the <code>OnScanResult</code> event is never fired. </p>
  
  <p>I've tested it on several iOS devices running several different versions (anywhere from 8.0 - 10.3) and fiddled with everything I can think of, referencing their sample projects as well. <code>ZXing.Net.Mobile</code> and <code>ZXing.Net.Mobile.Forms</code> nuget packages were installed in all projects.</p>
  
  <p>Here's my scanner code, triggered from a button press on my main page:</p>
  
  <pre><code>var scanPage = new ZXingScannerPage();
  
  scanPage.OnScanResult += (result) =&gt;
  {
      scanPage.IsScanning = false;
  
      Device.BeginInvokeOnMainThread(async () =&gt;
      {
          await Navigation.PopAsync();
          await DisplayAlert("Scanned Barcode", result.Text, "OK");
      });
  };
  
  await Navigation.PushAsync(scanPage);
  </code></pre>
  
  <p>and AppDelegate.cs:</p>
  
  <pre><code>public override bool FinishedLaunching(UIApplication app, NSDictionary options)
  {
      global::Xamarin.Forms.Forms.Init();
  
      global::ZXing.Net.Mobile.Forms.iOS.Platform.Init();
  
      LoadApplication(new App());
  
      return base.FinishedLaunching(app, options);
  }
  </code></pre>
  
  <p>After two days of fighting with this, I feel like I'm at my wit's end. Has anyone else encountered similar problems? Thanks for any guidance!</p>
  
  <hr>
  
  <p><strong>Edit 1</strong></p>
  
  <p>Here's the device log output (Message column only) when clicking the button to trigger the above code. No log items are added while the camera is open and pointed at various barcodes. I don't see anything suspicious here, but maybe someone else does?</p>
  
  <ul>
  <li>PERF: Alloc AVCaptureVideoPreviewLayer took 14.14 ms.</li>
  <li>AppleH4CamIn::power_on_hardware </li>
  <li>AppleH4CamIn::ISP_SelectBestMIPIFrequencyIndex_gated - channel: 0, index: 0</li>
  <li>StartScanning</li>
  <li>AppleH4CamIn::setPowerStateGated: 1 </li>
  <li>ZXingScannerView.Setup() took 0.167 ms.</li>
  <li>ASL Sender Statistics</li>
  <li>AppleH4CamIn::ISP_FlushInactiveDARTMappings: 0x00000000 </li>
  <li>AppleH4CamIn::ISP_SelectBestMIPIFrequencyIndex_gated - channel: 0, index: 0 </li>
  </ul>
  
  <p><strong>Edit 2</strong></p>
  
  <p>I ran the sample Xamarin Forms PCL from the <a href="https://github.com/Redth/ZXing.Net.Mobile" rel="nofollow noreferrer">github repo</a> and am having the same problems on iOS with the camera opening fine, but no barcode ever read. Therefore I'm thinking the problem must be with my Visual Studio and/or Xamarin setup. I'm running Visual Studio 2015 Community on the stable Xamarin channel.</p>