My goal:
My mobile app has been working for several weeks with a "fab" button that is able to launch a scanner object. Once a barcode or qrcode is scanned, the scanner automatically closes.
Issue:
Tomorrow, my team met an issue with the fab button, that freeze the app on scanner launch.
I then decided to avoid using the fab to open the scanner, which fixes the "freeze" issue.
However, even though the "single scan" property of my scanner object is checked, the scanner still allows multiple scans in a row.
(same wrong behavior if I uncheck the "single scan" property)
I wish the scanner closed once a barcode is catched.
Additional info: (Cloud version, app version 3.194.0 on Android device)
Is there any means of getting back to the former scanner version, to get a single scan ability ?
We've also noticed some weirdness with the scanner this morning.
With single scan on, the scanner remains open after scanning a barcode.
Calling scanner.clearValue() clears the value until another barcode is scanned, then the original is still in the data array.
So, scan barcode 1. data is now [1]. Call scanner.clearValue(), data is now []. Scan barcode 2. Data is now [1,2]. Call scaner.clearValue(), data is now [], scan barcode 3. Data is now [1,2,3]. You get the idea. Data should go [], [1], [], [2], [], [3] instead of [], [1], [], [1,2], [], [1,2,3]
Apologies for the issue, I am glad you were able to find Darren's solution in the other thread and that it works for you. I will mark this thread as closed.
@Kevin2 Thank you for reporting that odd behavior, I will investigate the scanner.clearValue() method to see if there's an explanation as to why it appears empty but ends up re-populating with previously cleared data and how we can fix that.
Shot in the dark but have you tried running scanner.close() after clearing? As described in the thread that alex linked as his solution? It could be a caching issue that would be solved by using that method to close it and emptying any stored data before the next scan
The single scan functionality is not working for us at all, which it was two weeks ago. After scanning one item, the scanner should automatically close. It is no longer behaving that way. In fact, now there is no functionality difference between having the single scan checkbox ticked vs unticked.
Kindly check as this is causing challenges for us.
Calling scanner.close() manually in the capture event does work to close the scanner and clear the value.
But in our case, we've now had to rebuild our scanning user journey across multiple apps in response to these bugs.
It used be scan barcode -> show confirmation with the scanned barcode (since the scanner isn't 100% accurate). In the confirmation, if cancel selected, clear value - scanner stays open. If confirm, close scanner. Since the clearvalue has stopped working we now need to close the scanner before showing the confirmation, then re-open it if the user wants a do over.
Also, regarding needing to call close scanner from the capture event, this is still an obscure extra step which is a fix for what appears to be unintended behaviour.
@Mohsan_Elahi Apologies for the issue. Let me forward this to our mobile team to take a look at.
@Kevin2 Thank you so much for the contextual details, let me talk to the mobile team that maintains the scanner and hopefully we can get the clearvalue method working again as expected. I agree that we should have built in behavior so that your app does not need to call close scanner from the capture event. This feedback will be very useful for the team to sort things out for a smooth user experience.