Closed mtanml closed 3 weeks ago
Starting with recent iOS versions, some WebView functionalities might require explicit permissions for things like local file access or network requests.
Info.plist
file, such as NSAppTransportSecurity
for loading non-HTTPS resources.Example:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
If the debugger isn't showing anything, enable WebView debugging via Safari:
Develop > Your Device > Your WebView
.iOS 18 might have introduced stricter CORS (Cross-Origin Resource Sharing) policies or network restrictions. If you're using the ProxyRequestReceived
event to load content dynamically, ensure that the responses are properly configured to include any necessary CORS headers.
args.ResponseHeaders.Add("Access-Control-Allow-Origin", "*");
Review the iOS 18 release notes for any WebView or WKWebView
deprecations or changes. Apple might have updated the default behavior of WebView controls. If there are deprecated APIs, you might need to update your WebView or its configuration accordingly.
Ensure that JavaScript is enabled in your HybridWebView
if you're relying on JS functionality. It's possible that this setting was reset or changed in iOS 18.
myHybridWebView.EnableJavascript = true;
iOS updates might affect how local assets (HTML, CSS, JS) are bundled and accessed. Double-check that the assets are being properly included in your app build and that the paths set in HybridAssetRoot
and MainFile
still point to the correct resources.
If the HybridWebView control continues to show issues, you could try falling back to using a standard WKWebView
directly. This can help rule out if the issue is with the HybridWebView
implementation or with the underlying WebKit framework on iOS 18.
Sometimes, web content might not load properly due to minor version incompatibilities in the web engine. Rebuild your web content (e.g., React app) and ensure that it uses updated dependencies.
Ensure that you're using the latest version of the EJL.MauiHybridWebView
package or any MAUI version that is compatible with iOS 18. Check for any available updates or known issues regarding iOS 18 in the package repository.
Create a simple HTML page (just basic HTML, no JS) and see if it loads properly in the HybridWebView
. If it does, then the issue might be with your JavaScript or other dynamic content.
@HelloooJoe thank you for your very fast response. Unfortunately I'm having some issues with your suggestions:
@HelloooJoe thank you for your very fast response. Unfortunately I'm having some issues with your suggestions:
- I'm not sure how WebView debugging works with the iOS Simulator
- I can't find the property myHybridWebView.EnableJavascript
hello,
I suspect the root of the problem lies in Apple blocking requests from 0.0.0.0. You need to download the library files and compile them yourself to use a different address, such as localhost.
This works for me, and I hope it can help you as well.
@beethmon thank you!
@Eilon are there any plans to update the library?
Hi yes this is a known bug that is fixed in the .NET MAUI official version.
@Eilon but it's only available in .NET 9 pre-release, right? My boss won't go for that. We'd rather continue using your solution for now. Possible to update it?
Yes I'll look into it
@Eilon you're a rockstar, thank you!
Dupe of #78
This worked great for us until users started updating to iOS 18, after which the webview is just a blank white box. I'm having a hard time troubleshooting... the debugger doesn't show anything. Any suggestions? Thanks