Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app freeze/unresponsive if closed without pressing close button #566

Open
2 of 3 tasks
timmliu opened this issue Nov 2, 2019 · 15 comments · May be fixed by #914
Open
2 of 3 tasks

app freeze/unresponsive if closed without pressing close button #566

timmliu opened this issue Nov 2, 2019 · 15 comments · May be fixed by #914

Comments

@timmliu
Copy link

timmliu commented Nov 2, 2019

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 80feff6 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

@rajild
Copy link

rajild commented Nov 6, 2019

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?

@timmliu
Copy link
Author

timmliu commented Nov 12, 2019

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).

@kobbe82
Copy link

kobbe82 commented Nov 29, 2019

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

@rajashekaranugu
Copy link

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 #612. closing it now.

tHANKS AGAIN

@torgnywalin
Copy link

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?

@chriswardo
Copy link

Is there any update on this? It means that pagesheet should never be used. It should either be removed as an option or fixed.

@am5815
Copy link

am5815 commented May 31, 2020

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?

@gnarco
Copy link

gnarco commented Sep 21, 2020

Same issue here ...

@timbru31
Copy link
Member

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

@gnarco
Copy link

gnarco commented Sep 21, 2020

I will post a sample app ASAP

@gnarco
Copy link

gnarco commented Sep 21, 2020

@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

@koczka
Copy link

koczka commented Oct 1, 2020

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 });
});

@FlawaCLV
Copy link

Any update on this issue ?

@antonello-alfatauristudio

any update on this?

@kentora kentora mentioned this issue Oct 21, 2021
5 tasks
kentora pushed a commit to kentora/cordova-plugin-inappbrowser that referenced this issue Oct 21, 2021
Prevents closing pagesheet by swiping down, which led to unresponsive app
@kentora kentora linked a pull request Oct 21, 2021 that will close this issue
5 tasks
@hooliapps
Copy link

Hello, i confirm that the code works on iOS 17 ?

Any plan to commit this in main depot ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet