cordova-plugin-inappbrowser
cordova-plugin-inappbrowser copied to clipboard
app freeze/unresponsive if closed without pressing close button
Bug Report
App freezes/becomes unresponsive if the in app browser is closed by swiping down instead of hitting the Close button.
Problem
What is expected to happen?
I would expect swiping down to have the same result as pressing the Close button and the app to continue to work as normal.
What does actually happen?
App becomes unresponsive, nothing in the UI works, there are no errors thrown or logs shown. Force killing the app resolves the issue.
Information
I'm using _blank for the in app modal, and usewkwebview=yes. Pulling latest master 80feff6cf8e3def9bdd388e56d6cb2dbb44a2d2c fixes the in app browser not showing up (issue in 3.1.0) but there is still an issue with swiping the browser modal away, which will not work as expected. I have tried various forks and updating other packages but have not been able to resolve.
Command or Code
Open in app browser, when closing, instead of pressing Close button (which works), swipe the modal down to dismiss it. The UI becomes unresponsive afterward.
Environment, Platform, Device
iOS 13.
Version information
"cordova": "^8.1.2", "cordova-ios": "^5.0.0", "cordova-plugin-ionic-keyboard": "^2.1.3", "cordova-plugin-wkwebview-engine": "^1.1.4", "cordova-plugin-wkwebviewxhrfix": "git+https://github.com/TheMattRay/cordova-plugin-wkwebviewxhrfix.git", "cordova-plugin-inappbrowser": "git+https://github.com/apache/cordova-plugin-inappbrowser.git", ...
Checklist
- [x] I searched for existing GitHub issues Similar to https://github.com/apache/cordova-plugin-inappbrowser/issues/426 but doesn't seem to be the same issue.
- [ ] I updated all Cordova tooling to most recent version I'm not able to update all the tooling atm.
- [x] I included all the necessary information above
I am also facing this issue.
Build prepared with Xcode 11 and running on iOS 13 simulator with usewkwebview=yes
Any progress on this issue?
This is not a fix but a workaround by playing with the options. I have it working with:
{
usewkwebview: "yes",
clearcache: "yes",
location: "no",
fullscreen: "yes",
enableViewportScale: "yes",
toolbar: "yes",
hidenavigationbuttons: "yes",
closebuttoncolor: "#8EA9F6",
closebuttoncaption: "Close",
presentationstyle: "fullscreen",
transitionstyle: "crossdissolve",
toolbartranslucent: "no",
toolbarposition: "bottom"
}
The difference maker here is presentationstyle: "fullscreen"
, which actually prevents the swipe-down closing action. You can only close it using the Close button, which circumvents the bug.
I coupled it with transitionstyle: "crossdissolve" so that it doesn't look like it's sliding up when it opens (which might subliminally indicate to the user they can swipe down to close it).
Same issue here, swiping down to dismiss should atleast trigger an exit event. More information can be found here: https://medium.com/@hacknicity/view-controller-presentation-changes-in-ios-13-ac8c901ebc4e
This is not a fix but a workaround by playing with the options. I have it working with:
{ usewkwebview: "yes", clearcache: "yes", location: "no", fullscreen: "yes", enableViewportScale: "yes", toolbar: "yes", hidenavigationbuttons: "yes", closebuttoncolor: "#8EA9F6", closebuttoncaption: "Close", presentationstyle: "fullscreen", transitionstyle: "crossdissolve", toolbartranslucent: "no", toolbarposition: "bottom" }
The difference maker here is
presentationstyle: "fullscreen"
, which actually prevents the swipe-down closing action. You can only close it using the Close button, which circumvents the bug.I coupled it with transitionstyle: "crossdissolve" so that it doesn't look like it's sliding up when it opens (which might subliminally indicate to the user they can swipe down to close it).
@timmliu thanks a lot. it worked for me. I have also opend an issue https://github.com/apache/cordova-plugin-inappbrowser/issues/612. closing it now.
tHANKS AGAIN
This is not a fix. This is just changing it back to how it was before. What if we want to use Pagesheet. It most be possible to listen for swipe event and dismiss as if we clicked the close button?
Is there any update on this? It means that pagesheet should never be used. It should either be removed as an option or fixed.
Is there any update on this? I actually want to keep the in app browser running after swiping down and hiding it but that as mentioned freezes the app. Is there any work around to minimize the browser, have it running in the background and go back to the app?
Same issue here ...
Is this reproducible in a new, plain Cordova app? A minimal reproduction repository would really help to debug and later fix this issue. More information on how to create one: https://github.com/apache/cordova-contribute/blob/master/create-reproduction.md
I will post a sample app ASAP
@timbru31, here a repo to reproduce : https://github.com/gnarco/inappbrowser-bug
on iOS, on app launch, it opens "in app browser" with a set predefined options.
- If I click on "close" button everything work perfectly (I can click on "click after" it opens a web page normally, just to simulate a user using an app)
- If I slide the inappbrowser bottom, the app "freeze". I can't click on "click after".
If I switch to : presentationstyle : fullscreen, it works. But in fact, it's just a workaround, because I can't slide to quit anymore :)
Thanks
I got a solution.
In my case, I was using the iab, to show a login portal, from an identity provider (SSO login), and when I got redirected with the user data, I'd navigate the user to the logged in home screen inside the ionic app.
The only modification I needed to do in my code, is to wrap the router.navitage
method in a ngZone.run
block.
So in my case it wasn't the plugin, it was angular that caused the behaviour.
this.ngZone.run(() => {
browser.close();
this.router.navigate(['/home'], { replaceUrl: true });
});
Any update on this issue ?
any update on this?
Hello, i confirm that the code works on iOS 17 ?
Any plan to commit this in main depot ?