apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.16k stars 987 forks source link

InAppBrowser + Keyboard Issue XCode 10 #470

Closed ehorodyski closed 5 years ago

ehorodyski commented 5 years ago

This is an issue that touches many areas so I hope placing it here is the proper place.

When running a Cordova project from XCode 10, the Keyboard no longer resizes the height of a flexbox in an InAppBrowser window. The same project, run using XCode 9, shrinks the flexbox (and I assume the height of the WKWebView itself?) to accommodate the keyboard.

The picture is worth a thousand words, so here it is: ios iab-keyboard

The list of plugins/platforms are as follows:

Platform

cordova-ios 4.5.5

Plugins

Relevant:

cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 2.2.0 "cordova-plugin-ionic-webview"
cordova-plugin-network-information 2.0.1 "Network Information"

Additional:

com-intel-security-cordova-plugin 2.0.3 "APP Security API"
com.googlemaps.ios 2.7.0 "Google Maps SDK for iOS"
cordova-plugin-calendar 5.1.3 "Calendar"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-googlemaps 2.1.1 "cordova-plugin-googlemaps"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-vibration 3.1.0 "Vibration"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-socialsharing 5.4.1 "SocialSharing"
cordova.plugins.diagnostic 4.0.10 "Diagnostic"
es6-promise-plugin 4.2.2 "Promise"
phonegap-plugin-push 2.1.3 "PushPlugin"
janpio commented 5 years ago

https://github.com/apache/cordova-plugin-inappbrowser/issues would probably be the better location for this issue.

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

ehorodyski commented 5 years ago

Hi @janpio -

I can certainly create a sample project! I'm a bit busy until next week so unfortunately it will have to wait until then but definitely looking forward to figuring out this issue!

ehorodyski commented 5 years ago

Here you go: https://github.com/ehorodyski/iab-issue

It's as minimal as I could make it. Considering we use Ionic as our framework I wanted to make sure I left that portion in as well for readability and to initialize the IAB the same way. In theory, it shouldn't affect how either the platform or the plugin is behaving. In theory 😄

janpio commented 5 years ago

Ok, so this is an Ionic project that reproduces the problem. https://github.com/ehorodyski/iab-issue/blob/f3308edc9ad4375d8af1a64d7df50a56ecbbe6fb/src/app/app.component.ts#L30-L35

ehorodyski commented 5 years ago

Ok, so this is an Ionic project that reproduces the problem.

Yes, you've annotated the lines correctly. Because the issue is related to native functionality I didn't think that using Ionic was a big issue.

However, now that I think about it, the Ionic keyboard and WKWebView plugins do expose 2 additional points of failure. I've gone through locally and removed those 2 plugins one-by-one to see if either of them were the culprit (along with other plugins, for sanity checking). At the end of the day, it InAppBrowser and cordova-ios were left and the issue still persisted. And since it only happened in XCode 10, I assumed it was an issue w/ cordova-ios and not a plugin issue.

janpio commented 5 years ago

Please understand that having an additional Ionic (Native) layer in the reproduction sample increases complexity and might hinder another user or committer to be able to just jump in an debug the problem. The optimal reproduction project really is just Cordova.

ehorodyski commented 5 years ago

Please understand that having an additional Ionic (Native) layer in the reproduction sample increases complexity and might hinder another user or committer to be able to just jump in an debug the problem. The optimal reproduction project really is just Cordova.

Understood. Let's see what tomorrow morning brings and hopefully I'll have some time to reproduce at just the Cordova level.

ehorodyski commented 5 years ago

Sorry for the delay; had to get some free time to reproduce.

I was able to reproduce the issue with a minimal Cordova project that just includes cordova-ios@^4.5.5 and cordova-plugin-inappbrowser@^3.0.0.

The repository is located here: https://github.com/ehorodyski/cordova-iab-ios-issue

Please let me know any further steps I can take to get this issue resolved. Is there any enterprise-level Cordova support that can look into this? In March, Apple is forcing all apps to be built through Xcode 10, built for iOS 12.x. Since this issue is specific to building for iOS 12.x, it's important we get it resolved.

janpio commented 5 years ago

Great, with the repro pointing to inappbrowser, you might want to open an issue at its repository and include all the relevant information: https://github.com/apache/cordova-plugin-inappbrowser - the chance is much greater that someone with specific knowledge about it will look at it over there. Thanks.

ehorodyski commented 5 years ago

Issue is resolved when using the master branch of the InAppBrowser plugin (3.1.0). Closing this issue.