Thanks Lerg and thanks for getting Front Camera in so quick. Will let you know how our project goes…!
Hi,
today i’ve this error
scansiona.lua:468: com.naef.jnlua.LuaRuntimeException: bad argument #1 to ‘show’ (expected table, got function)
here the line 468:
(It worked well yesterday).
qrscanner.show(listener)
Please, can you tell me how to fix it?
Regards,
Read the changes.
It’s now **qrscanner.show({listener = **listener})
Also listener now receives an event table, not message.
IN the docs the qrscanner.show seems to have this form: qrscanner.show{listener = ** listener}**
Neven seen methods being called like that before, but maybe it’s a lua short hand or something? It seems to work…
When a Lua function has only one argument (params table), parentheses can be omitted.
Hi Lerg - update is working really well - thanks. Just been playing with some of the features. When I use the topbar on IOS I get a lightning symbol in the top right hand corner. Does not seem to do anything when touched. I though it may put the flash light on (which would be good), but it does not seem to do anything. Are you aware of this icon? Do you know how it can be used?
matt405, awesome! The flash sign should turn on flash when back camera is used. Doesn’t work? Can you try other devices?
For some reason the QR scanner seems to have an affection for the jeans of my right leg…
Maybe it’s my symbol list that is too comprehensive?
symbols = {'qr', 'aztec', 'code39', 'code39mod43', 'code93', 'code128', 'codabar', 'databar', 'databar\_exp', 'datamatrix', 'ean8', 'ean13', 'interleaved2of5', 'itf14', 'i25', 'isbn10', 'isbn13', 'partial', 'pdf417', 'upca', 'upce' }
runewinse, yup, your jeans have hidden messages left by factory workers.
You can either shorten the symbol list (I don’t know which ones cause false detections) or you can add a filter regexp that filters out any values shorter than say 5 characters.
I knew it!
I can’t see any description in the docs about the different type of symbols. Is there a list somewhere that describes what each sumbol string means?
BTW: In your docs you write this:
Android:‘code39’, ‘code93’, ‘code128’, ‘codabar’, ‘databar’, ‘databar_exp’, ‘ean8’, ‘ean13’, ‘i25’, ‘isbn10’, ‘isbn13’, ‘partial’, ‘pdf417’, ‘qr’, ‘upca’, ‘upce’.
iOS:‘aztec’, ‘code39’, ‘code39mod43’, ‘code93’, ‘code128’, ‘datamatrix’, ‘ean8’, ‘ean13’, ‘interleaved2of5’, ‘itf14’, ‘pdf417’, ‘qr’, ‘upce’, ‘interleaved2of5’, ‘itf14’, ‘datamatrix’.
Where ‘datamatrix’, ‘interleaved2of5’ and ‘itf14’ seems to be listed twice for iOS.
If you check 30 secs out in the video (https://youtu.be/4PIdhArQKJc?t=30), you’ll see that the scanner reports a 17 digit number so it’s not that easy.
I have also tried to limit the symbol list to ‘qr’, ‘aztec’, ‘datamatrix’, ‘pdf417’ and still get these hidden messages from my jeans…
Well, I guess it’s not much to be done with this. Not such a big deal either.
Thanks for reporting!
Probably datamatrix causes jeans detections.
Just google the names of the symbols and you can see how they look like and where used.
With the new version I still have the same problem as before.
I need VERY simple app, that shows camera vide all the time, scans the QR and shows result on the screen.
Here’s my main.lua code:
display.setStatusBar(display.HiddenStatusBar) local qrscanner = require('plugin.qrscanner') local function onResult( event ) if ( event.isError ) then native.showAlert('QR Code Scanner', "Network error: "..event.response, {'OK'}) else native.showAlert('QR Code Scanner', event.response, {'OK'}) end end local function listener(event) local path = "http://mydomain.com/check.php?id="..event.message network.request(path, "GET", onResult) end qrscanner.show{listener = listener}
Every time it scans QR it shows me black screen. Let me decide what to do (close or leave it) inside my listener, please. Don’t close it or give me an option to leave it opened after the scan.
I have two devices: Samsung Galaxy K Zoom and Meizu MX5.
I’m trying your sample app and both gives me the same result:
-
press “Scan QR”
-
pick the QR code, getting green overlay
-
scanner slides right back to main buttons screen without any message
but the listener should call native.showAlert function and show me the result!
What’s wrong here?
Your listener performs network request, it could be network timeout if nothing happens. Or you might be missing the internet permission.
Now I think I understand what you want. You want to quickly go back to the scanner view. There is a room for improvement in such scenario.
However you should be able to call qrscanner.show{listener = listener} in your onResult function. You only have to forward declare the listener or put into a table so that it would be accessible from within the onResult function.
Turns out I get false positives for everything from keyboards to my own jottings on paper, but they seem to have gone away when leaving out ‘datamatrix’ and ‘aztec’ from the list.
The barcode scanning, however is still riddled with false positives:
Is it, with the current implementation, possible to check which symbol type that gives the false positive? Any undocumented event member mayhaps?
Or is the problem in my case that the mask is outside of the dotted scanning area? I’m not completely sure how these two areas interact.
I’m starting to wonder if it is something wring on my end. There are no ends to these false positives. I’ve attached a supersimple test app which I use to get the false positives in the video below:
( Seems that the beech desk I’ve got on my office is very popular )
Can you see anything wrong in my code that should result in these false positives?
4 of our live apps use this plugin and the button that uses this plugin just crashes because of the .show function change (Used to take 2 args, now only 1). and they all went unnoticed both by us and the Apple review team. We now have a “crash the app instantly” button. Could these changes happen less often?
Well, at least i’m now subscribed to this topic in case it happens again.
Same problem here.