-
Notifications
You must be signed in to change notification settings - Fork 699
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
I pressed the button once on iOS, but it is executed more than 3 times by Scan Default. #609
Comments
I am getting the same issue and I have the latest Xamarin VS and iOS. |
suggest version 2.1.47 |
I had the same issue in a Xamarin Forms project and the multiple call only happening on iOS. I tried downgrading to 2.1.47 but still had the same problem. The OnScanResult event wasn't always called exactly three times though, it varied but was almost always more than 1. I saw a suggestion elsewhere to set the DelayBetweenContinuousScans value on MobileBarcodeScanningOptions when creating the scanner page but this also didn't work. I eventually worked around it by rearranging the code slightly so the event handler removed itself the first time it was called and this seemed to fix it. Something like this....
|
Thanks for reporting this issue! Unforunately it took me way too long to respond 😭. Sorry, I apologize! Recently the source code for this project was completely refactored to modernize it. Many PR's were included in this effort, and many bugs were hopefully fixed. Please try out the latest 3.x series of NuGet packages (currently in prerelease). To try and make the project more maintainable in my spare time going forward, I've decided to close all existing issues to start with a clean slate. If you're still experiencing this issue on the newest version, please open a new issue with as much detail as possible. Thank you for your patience and understanding! Happy scanning! |
Xamarin.Forms
ZXing.Net.Mobile.Forms 2.2.9
Forms.iOS
iPhone iOS 10.3.3
I pressed the button once in the iOS environment and the scan is executed two or three times.
I want the scanner to run once.
your Sample :
buttonScanDefaultOverlay.Clicked += async delegate {
scanPage = new ZXingScannerPage ();
scanPage.OnScanResult += (result) => {
scanPage.IsScanning = false;
};
2017-08-21 17:31:43.567 FormsSampleiOS[1096:174134] ZXingScannerView.Setup() took 0.214 ms.
2017-08-21 17:31:43.568 FormsSampleiOS[1096:174134] StartScanning
2017-08-21 17:31:43.632 FormsSampleiOS[1096:174134] PERF: Alloc AVCaptureVideoPreviewLayer took 5.67 ms.
Thread started: #3
Thread started: #4
[0:] ==============FD11102=================
Thread started: #5
[0:] ==============FD11102=================
[0:] ==============FD11102=================
[0:] ==============FD11102=================
2017-08-21 17:31:45.612 FormsSampleiOS[1096:174134] Stopping...
The text was updated successfully, but these errors were encountered: