I am creating a barcode scanner app with scandit scanner using Onsen 2 and Monaca . I integrate the scan library as plugin cordova plugin add . Everything works fine with Android and iPad but for iOS 10+, its showing a weird behaviour. The camera get open only after i press the home button of the phone and soon the resume the app to foreground, the scanner work fine.
I found a similar question already asked here, but there is no answer yet here. Onsen 2 - Monaca CLI - Cordova plugins weird behavior
Please reconsider my question before marking duplicate as the issue is still open.
Below is my code
scan() {
console.log('............scan clicked...........');
(<any>window).Scandit.License.setAppKey(“xxxxxxxxxxxxxxxxxxxxx”);
var settings = new (<any>window).Scandit.ScanSettings();
settings.setSymbologyEnabled((<any>window).Scandit.Barcode.Symbology.EAN13, true);
settings.setSymbologyEnabled((<any>window).Scandit.Barcode.Symbology.UPC12, true);
settings.setSymbologyEnabled((<any>window).Scandit.Barcode.Symbology.EAN8, true);
var picker = new (<any>window).Scandit.BarcodePicker(settings);
picker.show(success, null, failure);
function success(session) {
alert("Scanned " + session.newlyRecognizedCodes[0].symbology + " code: " + session.newlyRecognizedCodes[0].data);
session.stopScanning();
}
function manual(content) {
ons.notification.alert("Manual: " + content);
}
function failure(error) {
ons.notification.alert("Failed: " + error);
}
picker.startScanning();
}
Any help is appreciated Thank you