How to display encoded QRCode in view?

I’d like to leverage BarcodeScanner plugin to encode text to generate and display QRCode, based on codes in below link.

http://ngcordova.com/docs/plugins/barcodeScanner/

But it’s said encoding not functioning.

// NOTE: encoding not functioning yet

Then how to do it in Ionic?

I found one Angular directive for QRCode generation as below link.

And it works in browser while running ‘ionic serve’, but didn’t display QRCode in iOS emulator. :frowning: Anyone encountered this issue?

1 Like

Hi

I’m using this
http://davidshimjs.github.io/qrcodejs/

and haven’t encountered any issues so far
it is pretty simple to use too, I just add it in my controller and it does it’s job well

No dependencies too

2 Likes

Thanks. I would try it.

Any way to easily generate a QR Code with a logo?

Any sample code on how to integrate http://davidshimjs.github.io/qrcodejs/ with ionic?

Hello there, I’m having the same issue, I also followed the code here but i can’t seem to get it working within the ionic project…

anyone can share?

I succeeded to make an encrypted Qr in ionic view using the angular-qrcode generator library. it was simple. Since i was creating a sidemenu app, i copied the directive found in angular-qrcode.js and pasted in the app.js file then i copied this short line of code :
<qrcode version="{{version}}" error-correction-level="{{level}}" size="{{size}}" data="{{var}}"></qrcode>
and pasted it in the views content. All i had to do was bind a controller to the view and the angular-qrcode library read the data from the <qrcode></qrcode> tag and out came an encrypted qr code. :smile:Bellow is a screen of the output

Hi, I’m using ionic 2 and everything is on typescript. How do you integrate the angular-qrcode generator library? Where? In the index.html file? How can I use it in a typescript file? I’m a bit lost.
Thanks

Is this still working?

Same problem here, did you manage to solve this?

Just follow the instructions.

I needed to generate a base64 encoded QR image on Android, iOS and Window.
Earlier this week, I could not find anything that worked across all platforms.

There is now a new Cordova plugin that does QR encoding.
It’s a pure JavaScript solution, so it should work on all platforms.
It gives you the base64 encode QR image.
Feel free to have a go:
https://github.com/MenelicSoftware/cordova-plugin-qrcodejs

Any feedback would be appreciated.

Thanks

How is it any better than the library linked in the post above yours? Why is Cordova involved at all?

Hello @rapropos
If the other solutions work for you, then no need to look elsewhere.

So, take this as an alternative to other working solutions :slight_smile: