QR Scanner

Is it, with the current implementation, possible to check which symbol type that gives the false positive? Any undocumented event member mayhaps?

I’ll look if it’s possible.

manolo, basiliogerman, I wish there was a mechanism to notify all plugin owners. Making it crash on show() at least makes the problem apparent, if I left optional 2 arguments, you would get errors in the listener processing, which would be much less apparent and hard to debug.

API change was necessary to update the code base and lay ground for any future updates, which should be non-breaking from this point. Sorry for the inconvenience.

Still, that would be so great to get the offline qr code generator one sunny day.

max.srdk, there is one https://forums.coronalabs.com/topic/65821-qrgenerator-for-corona/

Or this library http://speedata.github.io/luaqrcode/
Tweak it to make it run in Corona and you are set.

I got a runtime error when I tried to open the scanner from my iphone

Apr 28 17:29:38 iPhone Chop Stick[251] <Notice>: ERROR: Runtime error

bad argument #1 to ‘show’ (table expected, got function)

stack traceback:

[C]: in function ‘show’

?: in function ‘openScanner’

?: in function ‘?’

?: in function <?:190>

Apr 28 17:29:38 iPhone Chop Stick[251] <Notice>: Handling the unhandled error: bad argument #1 to ‘show’ (table expected, got function)

apps30, please follow the update here: https://forums.coronalabs.com/topic/58524-qr-scanner/page-10#entry355192
Listener is now a part of the params table and accepts an event table.

ok… just saw it. Thanks!

Thanks, the QR generator solution by Torben is pretty brilliant and works like a charm.

Keep a good job Torben, and thank you both for your efforts.

PLUGIN UPDATE

New stuff:

event.symbol - in the listener indicates what symbol type was scanned.

topbar.isHidden - in the show() params, set to true to hide the topbar.

Bug fixes:

Cancelled event now works on iOS.

Great! Thanks for the quick fix, Sergey!

Dave

Thanks Sergey!

I’ve tested a bit with the event.symbol and for those “false positives” the event.symbol is an empty string (not nil). For a “true positive” I get things like ‘ean13’ so it seems to work.

I can catch the false positives on my side, but then I’d have to fire the scanned up again. Maybe it’s possible for you to catch it on your side and not return at all if the symbol is empty?

runewinse, what os is that again?

The phone I tested on is a Nexus 6P running Android 7.1

runewinse, try again in an hour. You should see either “unknown” or “none”. Which that would be?

OK, I’ll try tonight (that is in ca 5-6 hours).

I’m having the same problem on iOS (not tested on Android), both with my own code and on the sample project 

Can you check if the plugin returns correct values in the code (print to console)? Could be something wrong with displaying the native alert.

The callback is not getting called, i.e. no logs appear when I do this :

local function qr\_listener(event) -- event.message variable contains the value of a scanned QR Code. print(" QR scanner in listener ") for k,v in pairs(event) do print(k.." = "..tostring(v)) end native.showAlert('QR Code Scanner', event.message, {'OK'}) end qrscanner.show({ listener = qr\_listener, })

Solved it, my Corona SDk was out of date, duh 

Hi,

I made another build to my phone just now and I still get an empty string (when I get a “false positive”).