1

I need to load html/CSS/Javascript files that have been previously downloaded from a server. I can do this on Android and iOS using UIWebView, but fails when enabling WKWebView.

I did some research and seems that there is a workaround to get this working. From this post, the solution could be this:

 if Url.scheme == "file" as String {
     wkWebView.loadFileURL(Url, allowingReadAccessTo: Url)
}
else {
     let request = URLRequest.init(url: Url, cachePolicy:.reloadIgnoringLocalCacheData, timeoutInterval:60)
     wkWebView.load(request)
}

Is this implemented on Codename One? Or there is a better way to get WKWebView working with downloaded html files?

Carlos Verdier
  • 245
  • 2
  • 10

1 Answers1

1

This is implemented in Codename One if you enable WKWebView and use a file system storage URL it should work seamlessly see: https://github.com/codenameone/CodenameOne/blob/master/Ports/iOSPort/nativeSources/IOSNative.m#L2490

Shai Almog
  • 51,749
  • 5
  • 35
  • 65