I have a mobile app that I have written that utilizes the barcodescanner plugin. It used to work just fine until about a week ago. Now when I run the app in the AppBuilder extension for Visual Studio 2015 I get the following error whenever the barcodescanner is initialized.
"Uncaught TypeError: Cannot read property 'barcodeScanner' of undefined at scripts/esig.js (line: 101)"
Below is the code used to initialize the scanner:
scanBarcode: function () {
cordova.plugins.barcodeScanner.scan(
function (result) {
if (!result.cancelled) {
app.esigService.viewModel.searchAccountNumber = result.text;
app.esigService.viewModel.getPatientByAccountNumber();
}
}, ...
When the app is loaded and then logged into the following code fires:
onLoad: function () {
if (app.isAuthenticated) {
if (app.esigService.viewModel.firstLoad) {
app.esigService.viewModel.scanBarcode();
app.esigService.viewModel.firstLoad = false;
app.esigService.viewModel.getFormGroups();
}
}
else {
global.app.application.navigate("#home");
}
},
The plugin is enabled in the properties of the app. I cannot figure out why I am getting this error. Any help is greatly appreciated.
Thank you,
Ken S.