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

With the new ios inappbrowser change for wkwebview support, the main webview content is disabled #334

Closed
jonathanli2 opened this issue Oct 28, 2018 · 4 comments

Comments

@jonathanli2
Copy link
Contributor

Just upgrade our product ios Fiori client app with the updated inappbrowser plugin for master with the wkwebview support.

However, somehow after loading the web content in the main webView (UIWebView or WKWebView), the UI element in the main webview is disabled. Clicking on the button or other UI element does not have any response.

The same app with inappbrowser version 2.0 works as expected.

To repeat the issue, the three ios projects are shared at the below folder:
https://sap-my.sharepoint.com/:f:/p/jonathan_li/EmulfDR6x9RBuQdj5u1-NrwBYchculWO6RAfoC_NTM8XLw?e=YzzUkh

2.0WithUIWebView.zip
Fiori client build with inappbrowser plugin version 2.0.x. The main webview uses UIWebView.

masterWithUIWebview.zip
Fiori client build with inappbrowser plugin from master. The main webview uses UIWebView.

masterWithWKWebView.zip
Fiori client built with inappbrowser plugin from master. The main webview uses WKWebView.

Steps to repeat the issue:

  1. build the xcode project and deploy to ios device. My device is iPhone 7 with iOS 12.0.1
  2. after start the app, click "Demo Mode" button
  3. Once the web content is shown, click the "See it in action" button.

When the project is built with inappbrowser 2.0 and UIWebView (2.0WithUIWebView.zip), click the "See it in action" button will go to the next page. In addition, double tab on the screen will show the toolbar items.

But after upgrading the project to latest inappbrowser plugin (masterWithUIWebview.zip), the main UIWebview does not response to the button click, or double tab. I also built a project with WKWebView as main UIwebView (masterWithWKWebView.zip), and got the same result.

Please look into this issue and see what causes this behavior change, particularly for the case when UIWebView is used as main webView.

Thanks
Jonathan

@jonathanli2
Copy link
Contributor Author

I created a simple UIWebView cordova app with just inappbrowser plugin, and it can repeat the same issue.

The project (basictest.zip) is also shared at the folder of
https://sap-my.sharepoint.com/:f:/p/jonathan_li/EmulfDR6x9RBuQdj5u1-NrwBYchculWO6RAfoC_NTM8XLw?e=YzzUkh

The project only has a simple openInappbrowser button, once it is opened, then clicking done button to close the inappbrowser. After the inappbrowser is closed. Clicking on the openInappbrowser button again will do nothing.

This indicates the issue is in the new inappbrowser plugin's implementation.

Jonathan

@dpa99c
Copy link
Contributor

dpa99c commented Oct 29, 2018

The bug was caused by PR #284 (prior to this, the window level was set to UIWindowLevelNormal and it worked fine). That PR was merged from master into PR #271 (which adds WKWebView support) in order to resolve merge conflicts, so the bug was carried across to the new implementation.

This issue is also covered by #314.

@jonathanli2
Copy link
Contributor Author

Just found out the issue is caused by the below code in CDVUIInAppbrowser.m
double baseWindowLevel = [UIApplication sharedApplication].keyWindow.windowLevel;
[tmpWindow setWindowLevel:baseWindowLevel+1];

If commenting out the above code, then the function will works as expected. I will submit a pull request to remove the code to set the window level for inappbrowser UIWindow.

Jonathan

@jonathanli2
Copy link
Contributor Author

Thanks Dpa99c.
Just saw your comment. I will wait for the PR #271 to be merged in the master.

Jonathan

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

2 participants