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

iOS 11.4.1 XCode 10.0 after inAppBrowser closed, app does not respond to touch events #314

Closed
datamystic opened this issue Oct 5, 2018 · 12 comments

Comments

@datamystic
Copy link

After the inAppBrowser is closed (after viewing a website), the app does not respond to normal touch events - touch, swipe etc.

The app still handles timer events in the background, so potentially this is an issue with how events are intercepted between the inAppBrowser and the underlying app, but the interceptor is not removed correctly when the inAppBrowser is closed.

@PieterVanPoyer
Copy link

PieterVanPoyer commented Oct 8, 2018

Which version of the inappbrowser are you using?
Which cordova version?
Which cordova-ios version?
And/or zip your project (including platform folder) of your broken app, please.

@datamystic
Copy link
Author

Which version of the inappbrowser are you using? 3.0.0
Which cordova version? 8.1.1
Which cordova-ios version? 4.5.5

@mobilestar2015
Copy link

mobilestar2015 commented Oct 8, 2018

I also faced this issue when I am using forked version of this plugin.
I found the reason why the app is not responding to touch events.
In the latest code(master branch at the moment), it creates temp UIWindow for the inappbrowser controller but after the controller closed, it doesn't remove newly created UIWindow from the superview.
So that there is UIWindow remained over the original UIWindow.
I resolved this issue by removing temp UIWindow on 'browerExit' method in CDVInAppBrowser.m
if (tmpWindow != nil) { [tmpWindow removeFromSuperview]; tmpWindow = nil; }
Hope this helps you @datamystic

@moldstadt
Copy link

Glad you found the solution @mobilestar2015. Any chance of submitting a pull request so that we can get this issue resolved?

@PieterVanPoyer
Copy link

PieterVanPoyer commented Oct 9, 2018

Same case here. I used a fork of the plugin and the app suffered from the same behaviour.
A pull request should be awesome!
But datamystic uses the 3.0.0 version and not a fork of the 3.0.1-dev version.
Maybe you could attach a zip file of your project excluding node_modules?
Duplicate of #296 ?

@mobilestar2015
Copy link

@moldstadt I created a PR for this bug fix.

@datamystic
Copy link
Author

I also faced this issue when I am using forked version of this plugin.
I found the reason why the app is not responding to touch events.
In the latest code(master branch at the moment), it creates temp UIWindow for the inappbrowser controller but after the controller closed, it doesn't remove newly created UIWindow from the superview.
So that there is UIWindow remained over the original UIWindow.
I resolved this issue by removing temp UIWindow on 'browerExit' method in CDVInAppBrowser.m
if (tmpWindow != nil) { [tmpWindow removeFromSuperview]; tmpWindow = nil; }
Hope this helps you @datamystic

That issue matches my symptoms exactly. How do we get a PR done?

@jacobg
Copy link

jacobg commented Oct 11, 2018

I'm having this problem on version 2.0.2, and I applied the following commit fix (not on npm yet) and it works fine: https://github.com/apache/cordova-plugin-inappbrowser/pull/272/files

Does that fix not work for you?

@jacobg
Copy link

jacobg commented Oct 11, 2018

Actually, both patches are necessary:

This:

- (void)browserExit
{
    if (tmpWindow != nil) { [tmpWindow removeFromSuperview]; tmpWindow = nil; }

And this:

[tmpWindow setWindowLevel:UIWindowLevelNormal];

@datamystic
Copy link
Author

I also faced this issue when I am using forked version of this plugin.
I found the reason why the app is not responding to touch events.
In the latest code(master branch at the moment), it creates temp UIWindow for the inappbrowser controller but after the controller closed, it doesn't remove newly created UIWindow from the superview.
So that there is UIWindow remained over the original UIWindow.
I resolved this issue by removing temp UIWindow on 'browerExit' method in CDVInAppBrowser.m
if (tmpWindow != nil) { [tmpWindow removeFromSuperview]; tmpWindow = nil; }
Hope this helps you @datamystic

That issue matches my symptoms exactly. How do we get a PR done?

I have tested this change and it works perfectly.

@gunchungpyo
Copy link

Yes, I have same issue here is the detail
inAppBrowser 3.0.0
cordova-ios 4.5.4
cordova-cli 7.1.0

I tried to downgrade to inAppBrowser 1.7.4 the issue still there.
and finally solved it by downgrade to inAppBrowser 1.4.0

@dpa99c
Copy link
Contributor

dpa99c commented Oct 29, 2018

This bug was caused by PR #284 - prior to this, the window level was set to UIWindowLevelNormal and it worked fine.

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

No branches or pull requests

7 participants