document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady() {
QRScanner.prepare(onDone);
function onDone(err, status) {
if (err) {
console.error(err);
}
console.log(status);
if (status.authorized) {
console.log('Authorized');
} else if (status.denied) {
console.log('Denied');
} else {
console.log('Denied 2');
}
}
document.getElementById("scan").onclick = ()=>{
QRScanner.scan(displayContents);
function displayContents(err, text){
if(err){
console.error(err);
} else {
alert(text);
}
}
QRScanner.show(function(status){
console.log(status);
});
};
}
Console displays "Authorized", the screen goes black when the button is clicked. onclick code is called but, displayContents is never called.
The status callback from the show() function seems ok.
I have used the camera on this device within a Cordova app to take stills so it is possible to access the camera.
index.html <!DOCTYPE html>
index.css
index.js
Console displays "Authorized", the screen goes black when the button is clicked. onclick code is called but, displayContents is never called.
The status callback from the show() function seems ok. I have used the camera on this device within a Cordova app to take stills so it is possible to access the camera.
Using Cordova Android 9.1.0