Decoding QR Codes in NG Client

Hi all,
I have a solution for a client in NG that now needs to be able to scan & decode QR codes.
Years ago I found an app for iOS that allowed a browser within the scanning app and when you entered a Servoy field & clicked the ‘scanner’ button it would read whatever barcode it was pointed at & send the decoded output as text in to the field (it was called iCody but the company is now out of business).
I have imported the “svywebcam” component in to my solution which allows me to access the web cam & capture an image as base64, but I now need to do something with that image/base64 to convert it to the decoded QR code.
Does anyone here have any experience/code for decoding QR codes in Servoy, or a way for me to use something like

or

within my solution?
Or an online API that I can just pass my base64 to and get some JSON or similar back with the decoded QR code? [most online API’s require a URL to a file to be sent & I don’t really want to have to capture/encode/save image/call API each time…

If no one can answer the above, then please point in the direction of how to import & use “js” library files with code in them into my solution (I think I have to import the .js files in to my Media folder, but not sure what to do next??

Thanks
Rafi

Have you viewed

Maybe it is not up to date (2 years ago>).

pitc:
Have you viewed
GitHub - Servoy/svyQRCode
Maybe it is not up to date (2 years ago>).

Hi Tom,
No! I hadn’t seen that, thank you!
Not much documentation on that, but I will give it a try later.
Fingers crossed :D
Thanks
Rafi

Hi
that is looking good so far (it’s actually my son who is trying to get it to work & he has managed to do some stuff already with, but needed to tweak some of the code)
It would be great if Servoy/Patrick could finish it off & add it to the rest of the Servoy Web Packages/Components…
Thanks
Rafi

rafig:
It would be great if Servoy/Patrick could finish it off & add it to the rest of the Servoy Web Packages/Components…

You could consider a pull request on Servoy’s project to get your improvements as part of the project.
This is the way to go… fixed a bug / made an improvement? Send it over to Servoy for review and have it merged.

mboegem:
You could consider a pull request on Servoy’s project to get your improvements as part of the project.
This is the way to go… fixed a bug / made an improvement? Send it over to Servoy for review and have it merged.

I might do that when I’ve worked out (with my son) what needed changing/fixing etc.
Thank

Hello, Rafi’s son here.

‘svyQRCode’ works perfectly on the computer, with webcam and recognising the QR codes.
When I try on IOS safari or chrome, the camera doesn’t turn on and the permissions to turn it on are not requested. I also tried on a chrome book and it also doesn’t work.
The javascript is using ‘getuserMedia’, I tried the code itself on jsfiddle and that works and opens the camera on iphone ios, so I’m presuming it’s something else going on in Servoy or the rest of the ‘svyQRCode’.

Importantly, I tried the ‘svywebcam’ component on the computer which works, and on the phone it doesn’t. This uses a different method to turn on the camera which I’m not sure about.
So, my problem is I am unable to activate the camera on a phone through Servoy, if anyone has any experience with this then advice would be appreciated.

Thanks for any help!
Zac.

All working now!

No fault with the QR code plug in. It simply required https, which I found out is a requirement of ‘getUserMedia’.
Just FYI: On local host, which I believed was ‘secure’, the desktop camera works but the phone doesn’t. On an http server neither works, on an https server both works.

Thanks everyone anyway :)