iOS barcode scanner screen shows behind inappbrowser screen
jonathanli2 opened this issue · comments
Expected Behaviour
When inappbrowser window is shown, if main uiwebview or wkwebview calls barcode scanner plugin method to scan a barcode, the barcode screen should show to user to scan the barcode
Actual Behaviour
The barcode screen is shown behind the inappbrowser screen, so user cannot user it.
Reproduce Scenario (including but not limited to)
ios cordova app using both inappbrowser and barcode scanner
Steps to Reproduce
1.Create cordova ios app with both inappbrowser and barcode scanner plugin
2.display inappbrowser, and on loadstop event, call barcode plugin scan method
3.the barcode scan screen does not show
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
iOS, ios 11, 10
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
Cordova CLI version and cordova platform version
cordova 7.0.1 and up
iOS 4.4.0 and up
Plugin version
current release versions
Sample Code that illustrates the problem
function scan(){
var win = window.open( "https://www.google.com", "_blank" );
win.addEventListener( "loadstop", function() {
setTimeout(function() {
cordova.plugins.barcodeScanner.scan(
function (result) {
alert("We got a barcode\n" +
"Result: " + result.text + "\n" +
"Format: " + result.format + "\n" +
"Cancelled: " + result.cancelled);
},
function (error) {
alert("Scanning failed: " + error);
},
{
preferFrontCamera : true, // iOS and Android
showFlipCameraButton : true, // iOS and Android
showTorchButton : true, // iOS and Android
torchOn: true, // Android, launch with the torch switched on (if available)
saveHistory: true, // Android, save scan history (default false)
prompt : "Place a barcode inside the scan area", // Android
resultDisplayDuration: 500, // Android, display scanned text for X ms. 0 suppresses it entirely, default 1500
formats : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED
orientation : "landscape", // Android only (portrait|landscape), default unset so it rotates with the device
disableAnimations : true, // iOS
disableSuccessBeep: false // iOS and Android
}
);
}, 1000 );
});
Logs taken while reproducing problem
@jonathanli2 the in app browser is an overlap that appears over top of your app so I wouldn't expect what you are trying to do to work, nor will we attempt to fix it.
Since inappbrowser does not have the full function as the main UIWebView, when InAppbrowser is shown on top of the main UIWebView, the inappbrowser may still need main UIWebView to interact with user for certain operation, like scanning a barcode to avoid user input a long string. So the plugin should be able to handle those cases when InAppbrowser is presented by main webview.
Is there any drawback to support this feature?
This thread has been automatically locked.