For some reason we cannot force mobile site presentation in WKWebView on iPad. We tried different things like installing different customUserAgent on webView, or using
Nothing seems help and the site shows as desktop which hides all kinds on buttons on the bottom of the page. Safari displays the site perfectly as a mobile version and resizes it properly. What can I do else in order to show the site as mobile?
Code Block - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction preferences:(WKWebpagePreferences *)preferences decisionHandler:(void (^)(WKNavigationActionPolicy, WKWebpagePreferences *))decisionHandler API_AVAILABLE(ios(13.0)){ preferences.preferredContentMode = WKContentModeMobile; if (@available(iOS 14.0, *)) { preferences.allowsContentJavaScript = YES; } else { // Fallback on earlier versions } decisionHandler(WKNavigationActionPolicyAllow, preferences); }
Nothing seems help and the site shows as desktop which hides all kinds on buttons on the bottom of the page. Safari displays the site perfectly as a mobile version and resizes it properly. What can I do else in order to show the site as mobile?