Appverse.Platform.IPhone.IPhoneScanner.DetectQRCode C# (CSharp) Method

DetectQRCode() public method

public DetectQRCode ( bool autoHandleQR ) : void
autoHandleQR bool
return void
		public override void DetectQRCode (bool autoHandleQR)
		{
			UIApplication.SharedApplication.InvokeOnMainThread (delegate {

				UIViewController viewController = UIApplication.SharedApplication.KeyWindow.RootViewController;

				MobileBarcodeScanner scanner = new MobileBarcodeScanner(viewController);

		
				scanner.Scan().ContinueWith(t => {   
					MediaQRContent resultQRContent = null;
					if (t.Result != null){
						resultQRContent = new MediaQRContent(t.Result.Text, ZxingToBarcode(t.Result.BarcodeFormat), getQRTypeFromCode(t.Result));
						//SystemLogger.Log(SystemLogger.Module.PLATFORM, "QR CODE returnValue: " + resultQRContent);
					}

					UIApplication.SharedApplication.InvokeOnMainThread (delegate {
						FireUnityJavascriptEvent(viewController, "Appverse.Scanner.onQRCodeDetected", resultQRContent);
						if(autoHandleQR) HandleQRCode(resultQRContent);
					});

				});
				// TODO: check how to do this
				//IPhoneServiceLocator.CurrentDelegate.SetMainUIViewControllerAsTopController(false);
			});

		}