uno-platform

Provide WebView with Url to Asset


In my Uno UWP project, I can view an html Asset file (w/ Content BuildAction), stored in my shared project, using the following:

   var myAssetUri = new Uri("ms-appx-web:///Assets/Html/index.html");
   myWebView.Navigate(myAssetUri);

However, this does not work with Android or WASM (not yet tried on other platforms). On WASM, I get a blank page. On Android, I get a page with the message:

The webpage at ms-appx-web:///Assets/Html/index.html could not be loaded because: net::ERR_UNKNOWN_URL_SCHEME

When I look at the package folders for both platforms, I do find my html file:

so, I am guessing I'm not doing something right ... but I don't know what that might be.


Solution

  • The cause is simple: WebView not implemented yet on Wasm nor Skia.