Decoding QR Codes in NG Client

Forum to discuss the new web client version of Servoy.

Decoding QR Codes in NG Client

Postby rafig » Sun Oct 03, 2021 6:32 pm

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
https://github.com/zxing/zxing
or
https://github.com/LazarSoft/jsqrcode
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
Servoy Certified Developer
Image
rafig
 
Posts: 611
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: Decoding QR Codes in NG Client

Postby pitc » Sun Oct 03, 2021 11:22 pm

Have you viewed
https://github.com/Servoy/svyQRCode
Maybe it is not up to date (2 years ago>).
Tom
prospect-saas.com
pitc
 
Posts: 82
Joined: Thu Nov 14, 2019 2:22 pm
Location: Ottawa, Ontario, Canada

Re: Decoding QR Codes in NG Client

Postby rafig » Mon Oct 04, 2021 9:15 am

pitc wrote:Have you viewed
https://github.com/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
Servoy Certified Developer
Image
rafig
 
Posts: 611
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: Decoding QR Codes in NG Client

Postby rafig » Mon Oct 04, 2021 10:42 pm

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
Servoy Certified Developer
Image
rafig
 
Posts: 611
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: Decoding QR Codes in NG Client

Postby mboegem » Tue Oct 05, 2021 12:34 am

rafig wrote: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.
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1572
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Decoding QR Codes in NG Client

Postby rafig » Tue Oct 05, 2021 1:51 pm

mboegem wrote: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
Servoy Certified Developer
Image
rafig
 
Posts: 611
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: Decoding QR Codes in NG Client

Postby zac1633523284 » Wed Oct 06, 2021 2:57 pm

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.
zac1633523284
 
Posts: 2
Joined: Wed Oct 06, 2021 2:28 pm

Re: Decoding QR Codes in NG Client

Postby zac1633523284 » Thu Oct 14, 2021 9:47 pm

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 :)
zac1633523284
 
Posts: 2
Joined: Wed Oct 06, 2021 2:28 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 1 guest

cron