bitpay / cordova-plugin-qrscanner

A fast, energy efficient, highly-configurable QR code scanner for Cordova apps and the browser.
MIT License
573 stars 776 forks source link

Not working on Framework7 #172

Open daksamedia opened 6 years ago

daksamedia commented 6 years ago

I worked around with this plugin and got nothing. I use Framework7 and camera won't appear properly.

app.js $$(document).on('deviceready', function() { console.log("Device is ready!"); //app.statusbar.show(); scan_qr() }); function scan_qr(){ /* cordova.plugins.barcodeScanner.scan( function (result) { app.dialog.alert("We got a barcode\n" + "Result: " + result.text + "\n" + "Format: " + result.format + "\n" + "Cancelled: " + result.cancelled); }, function (error) { app.dialog.alert("Scanning failed: " + error); }, { orientation : "portrait" } ); */ QRScanner.scan(qr_callback) QRScanner.show() } var qr_callback = function(err, contents){ if(err){ app.dialog.alert(err._message); } app.dialog.alert('The QR Code contains: ' + contents); };

I will appreciate whoever here get me help. thank you.

claudesoft commented 6 years ago

Hi, you need to hide some Elements because they have a white BG:

Start QR Scanner, then: (jQuery solution)

         window.setTimeout(function(){
           $(".page-previous").addClass('hideEl')
           $(".page-current").addClass('transparentBg')
           $("body").addClass("transparentBg")
           $(".page-current .page-content").addClass("hideEl")
         },1500)

when done: $('*').removeClass("transparentBg"); $('*').removeClass("hideEl");

My CSS:

.transparentBg { background-color: transparent !important; } .hideEl { display: none }

Maybe not the best solution but it works ;)

jigar-jstechno commented 6 years ago

Not Working This Solution

masterix21 commented 5 years ago

Use before "scan" method:

setTimeout(() => { document.getElementById('framework7-root').style.display = 'none' }, 1000);

And it after results:

document.getElementById('framework7-root').style.display = 'block';

scramatte commented 5 years ago

Hi,

Can you post a complete working example here? I'm unable to get the preview ...

Thank you

heyitsnovi commented 5 years ago

Use before "scan" method:

setTimeout(() => { document.getElementById('framework7-root').style.display = 'none' }, 1000);

And it after results:

document.getElementById('framework7-root').style.display = 'block';

This works on browser , but in mobile (Android) it only shows white screen.

ghost commented 5 years ago

Hi, you need to hide some Elements because they have a white BG:

Start QR Scanner, then: (jQuery solution)

         window.setTimeout(function(){
           $(".page-previous").addClass('hideEl')
           $(".page-current").addClass('transparentBg')
           $("body").addClass("transparentBg")
           $(".page-current .page-content").addClass("hideEl")
         },1500)

when done: $('*').removeClass("transparentBg"); $('*').removeClass("hideEl");

My CSS:

.transparentBg { background-color: transparent !important; } .hideEl { display: none }

Maybe not the best solution but it works ;)

Works like the German train schedule! Thanks :D