Questions tagged wkwebview

Explore the latest questions and answers asked by our top developers.

WKWebView content is too small when running as a Catalyst app on Mac

I started porting my iOS app (which works on iPhone and iPad) over to Mac via the Catalyst route but WKWebView is behaving very strange. All the content is too small, it looks like it thinks the monitor is 2 times bigger. The website I am displaying is responsive and works correctly on iOS devices […]

By Filip
Published
Categorised as ios, mac-catalyst, macos, wkwebview Tagged , , ,

Enable WebRTC Support in WKWebView/UIWebView

I am developing a flutter application using WebRTC in webview. On android, it is working as expected, but facing issues on iOS build. I have read the threads Apple Support and SO Thread. Both threads state, WebRTC is not allowed inside iOS webview. I tested my code in emulator/real-device, but unsuccessful. So, my question is […]

By Faiizii Awan
Published
Categorised as android, flutter, ios, swift, wkwebview Tagged , , , ,

Problem with WKWebView in Thumbnail Extension

Developing a thumbnail extension for a custom file type in my iOS app. I am using a WKWebView to render an HTML string and then capturing a snapshot of the WKWebView to use for the thumbnail image. Works great on simulators. However, not completing when run on a real device. Here is the code: let […]

By Chuck Krutsinger
Published
Categorised as ios, swift, thumbnails, wkwebview Tagged , , ,

SwiftUI – iOS 13 UIViewRepresentable of WKWebView gets Thread 1: EXC_BREAKPOINT crash

I’m trying to port WKWebView over to SwiftUI, but I get Thread 1: EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0) With nothing printed in the console. But, on iOS 14.2, it works fine. Here’s my code: import SwiftUI import WebKit struct ContentView: View { var body: some View { WebViewWrapper() } } /** WKWebView ported over to SwiftUI with […]

By aheze
Published
Categorised as ios, swift, swiftui, uiviewrepresentable, wkwebview Tagged , , , ,

Save display state of WKWebView

I want to be able to save the state of a WKWebView when a user quits out of my app and be able to restore it to exactly how it was when the user returns to the app. I want it to restore websites with forms, online calculators that store the history of calculations, or […]

By Antonio
Published
Categorised as ios, save, web, webarchive, wkwebview Tagged , , , ,

Cordova iOS 6+ Autoplay Video in External Screen

I’m using cordova-plugin-wkwebview-external-screen to playback inline media on a secondary screen (via AirPlay or HDMI adapter). The media loads fine but does not autoplay videos in the external webview. (autoplay works fine in primary webview) In my config.xml I have the following: <preference name="AllowInlineMediaPlayback" value="true" /> <preference name="MediaTypesRequiringUserActionForPlayback" value="none" /> I have attempted adding the […]

By Josiah
Published
Categorised as cordova, html5-video, ios, wkwebview Tagged , , ,

Cordova iOS 6.1.0 How to display images on external screen in WKwebview

I have a Cordova app that uses this plugin (cordova-plugin-wkwebview-external-screen) to display images/media full screen on an external screen via Airplay/HDMI adapter (similar to Apple’s Keynote). All worked smoothly with UIwebview, but I’m having trouble displaying media on my external screen with WKwebview. I’m now using Cordova iOS 6.1.1 (CLI 10.0). I’m using window.WkWebView.convertFilePath() to […]

By Josiah
Published
Categorised as cordova, ios, wkwebview Tagged , ,

How to fix WebView layout in Xamarin Forms after rotation on iOS (WKWebView)

I’m encountering problems getting a WebView to take up the whole screen properly in an iOS app using Xamarin Forms 4.8.0.1364 & in a ContentPage. The native control is WkWebView and am testing in an iPhone 12, iOS 14.1 Simulator. Also, when the device rotates back into portrait orientation, the size of the WebView is […]

By Wes
Published
Categorised as ios, layout, webview, wkwebview, xamarin.forms Tagged , , , ,

Load html text in WKWebView

I use this code to load my html file with text in WKWebView: do { guard let filePath = Bundle.main.path(forResource: "(readBookNumber)", ofType: "html") else { print ("File reading error") return } var content = try String(contentsOfFile: filePath, encoding: .utf8) let baseUrl = URL(fileURLWithPath: filePath) content.changeHtmlStyle(font: "Iowan-Old-Style", fontSize: UserDefaults.standard.integer(forKey: "textSize"), fontColor: textColor) webView.loadHTMLString(headerString+content, baseURL: baseUrl) } […]

By User
Published
Categorised as html, ios, swift, wkwebview, wkwebviewconfiguration Tagged , , , ,

Load html file from data directory in cordova-ios from WKWebview

I am working on cordova-ios app. My App will download zip file(contains html files ex:-second_login.html) from server, then we are unzipping it in data directory. After successful unzipping, app should navigate to second_login.html. App is working fine in UIWebview with cordova-ios 5.1.1. But it is not working in cordova-ios-6.1.0 with WKWebview. Using cordova-ios-6.1.0, I downloaded […]

By sham y
Published
Categorised as cordova, cordova-ios, ios, wkwebview Tagged , , ,
1 2 3 6

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq