I'm using Xamarin.Forms and I have implemented ZXing.Net.Mobile for scanning bar codes.
On Android it's working fine, on iOS 10 after reading a barcode the function "OnScanResult" is fired and executes the command Navigation.PopAsync() which closes the scanning page but after a second it closes also the current page where I have displayed the result !
MyTapScan.Tapped += async (sender, e) =>
{
await MyBtScan.ScaleTo(1.20, 100, Easing.Linear);
await MyBtScan.ScaleTo(1, 100, Easing.Linear);
await Task.Delay(50);
//--------------------------------------------
MyAppLib.MyAppUtilitiesBarCodeReader MyBarCodeReader = new MyAppLib.MyAppUtilitiesBarCodeReader();
var MyScannerPage = MyBarCodeReader.GetBarCodeReaderPage();
//--------------------------------------------
MyScannerPage.OnScanResult += (result) => {
//Stop scanning
MyScannerPage.IsScanning = false;
//Pop the page and show the result
Device.BeginInvokeOnMainThread(() => {
Navigation.PopAsync();
MyMachSerialNumber.Text = result.Text;
});
};
//--------------------------------------------
//Display scanner
await Navigation.PushAsync(MyScannerPage);
};
Please please help..!! :)