Open Noppey opened 4 years ago
Do you experience this on iOS/Android/both?
Sorry it took me some time to test it on iOS as well through sidekick.
I only experience this on Android. It seems to work fine on iOS.
Would you mind testing the demo app in this repo? I tried to reproduce the problem with that app and failed (scanning remained working using the "unlimited scan, allow duplicates" option).
Instructions are at the top of the readme.
Ok I've set the property reportDuplicates: true and now it works fine. Somehow it might still think it's in the same scanning session if I'm re-opening my application or something. I'm not sure what's going on.
Anyway, for me using reportDuplicates: true solves my problem, as I don't mind hitting continuousScanCallback for values multiple times given my code.
I reproduced the issue on your application by removing reportDuplicates:true with npm run demo.android.
Click on unlimited scan, allow duplicates. Scan code once. Hit back. Scanner closed is logged. Click unlimited scan, allow duplicates again. Scan same code again. No results.
I would expect that hitting back (closing the scanner) and reopening would create a clean scanning session.
If I'm reading your tests correctly then I'd expect the setting of "allow duplicates" not to be relevant at all. I think that backbutton is somehow not cleaning up the previous session correctly. I wish I had time to look into it though.
You're correct in the sense that it doesn't have influence on the session not being cleaned up. But obviously if you use continuousScanCallback with allow duplicates on, then it doesn't really matter if it's a new session or not.
Op di 18 feb. 2020 om 21:09 schreef Eddy Verbruggen < notifications@github.com>:
If I'm reading your tests correctly then I'd expect the setting of "allow duplicates" not to be relevant at all. I think that backbutton is somehow not cleaning up the previous session correctly. I wish I had time to look into it though.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/EddyVerbruggen/nativescript-barcodescanner/issues/234?email_source=notifications&email_token=AC7HKH5LRZTVEX3IJ64PVX3RDQ6AJA5CNFSM4KWNIDSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMEJVII#issuecomment-587766433, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC7HKHZOUDCPOFUQBLKTQODRDQ6AJANCNFSM4KWNIDSA .
I recently tried to switch to ContinuousScanCallback to resolve my scan result, instead of using the promise of barcodeScanner.scan itself.
When reading an QR code, this works fine the first time. But if I close and re-open my application, the ContinuousScanCallback doesn't get triggered anymore. I do here the scanning beep. There is also no resolve/reject occurring for the barcodeScanner.scan() promise.
Without continuouScanCallback everything works fine, I'm using the same QR code for testing all the time.