The application so far is just a button that opens the barcode scanner and displays the results when it returns, easy enough. However, when you press the button the following screen shows up: http://i.imgur.com/2XOPLvU.png?1
Restarting my device made no difference. Camera works with other applications that require the use of the camera.
Here is the code for the Controller:
QRKeeper.controller('ScannerController', function($scope, $cordovaBarcodeScanner){
//Function that runs the scanner
$scope.scanCode = function(){
console.log("Scan button pressed");
$cordovaBarcodeScanner.scan()
.then(
function(response){
if(!response.cancelled){
console.log("Scan successful");
} else {
console.log("Scan cancelled");
}
}, function(error){
console.log("Error when trying to read code");
}
);
}
});
Wrapping it in deviceready
as recommended on the Ionic website made no difference. When executing, chrome://inspect
did not show any error logs.
Thank you!
I am using this barcode scanner https://github.com/phonegap/phonegap-plugin-barcodescanner
Using the ngCordova plugin http://ngcordova.com/docs/plugins/barcodeScanner/