We are using WKWebView to load content from a local server. On specific iPhones running the latest iOS, the web view gets stuck on the loading state. We confirmed this is a system-wide networking issue because the same URL also fails to load in mobile Safari. Workaround: The only way to restore connectivity to the local host is to reboot the iPhone. this happens on last iOs releases on some iPhones with ios 26.2 and 26.3
wkwebview/safari failed to load local http webview
Thank you for the post. I am not aware of any bugs in making a request. Could you please provide a focused sample demonstrating the issue? Are you using URLSession configurations, or is it a straightforward request?
Crappy code below but please do not use it as I didn't even use Xcode for it.
if let url = URL(string: "https://www.apple.com")
let task = session.dataTask(with: url) { data, response, error in
// If you want to convert data to string and print
if let htmlString = String(data: data, encoding: .utf8) {
// response
}
}
Ensure your local server is configured correctly, especially in terms of HTTP headers. Validate that all required headers (like , , etc.) are properly set.
Verify server logs for any errors or unusual activity when the requests from these devices come in. If your local server uses HTTPS, ensure that your SSL certificate is valid. Although it's a local server, ensure there are no DNS-related configurations interfering.
Try accessing via IP address directly instead of a hostname. If you’re using HTTP/2, consider falling back to HTTP/1.1 temporarily to see if it mitigates the issue, as it could be related to how HTTP/2 is handled on those devices.
I'm not very good with server configuration, I would suggest to provide the focused sample against a server that always replies.
Albert Pascual Worldwide Developer Relations.