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

Feature Request: Add support for cordova PreferredContentMode setting #609

Open
kushagranigam opened this issue Sep 2, 2020 · 1 comment

Comments

@kushagranigam
Copy link

With Cordova iOS v6.1.0, a new preference PreferredContentMode is added for use. This setting allows developers to set preferredContentMode configuration for WKWebView available in iOS 13.0 and newer versions.

At present, adding iOS platform using ionic cordova platform add ios creates a CordovaLib project with CDVWebViewEngine.m in Private/Plugins directory that provides usage for this setting. Although, this code will not execute unless cordova-plugin-ionic-webview is removed from plugins. Once removed from plugins, the platform can be detected properly on iPadOS 13+ when mobile value is provided for PreferredContentMode preference in config.xml. In other cases, the platform is detected as desktop web browser.

@kushagranigam kushagranigam changed the title Add support for cordova PreferredContentMode setting Feature Request: Add support for cordova PreferredContentMode setting Sep 2, 2020
@a-kalmykov
Copy link

I got a strange bug when the WebView is hanging after some manipulations with sqlite database (cordova-sqlite-storage). In that
case the watchdog is restarting WebView after 30 seconds. It doesn't matter if the debugger was connected or not. Also there's no errors on console.
After some investigation I tried to switch the contentMode to "mobile" and it helped me. The app is working fine as on iOS 12.

Apple API documentation: WKWebpagePreferences::preferredContentMode

Created PR #612

I think this property affects not only the User Agent but also the behavior of WebView engine, probably it uses some desktop features that lead to unexpected bugs.

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