We are about to make a hybrid app of sorts of our current Web based app to enable offline usage along with some more usage of native app functionality in mobile devices. The app we are developing is today running on .net5 (soon to be 6) under iis and we have decided to use .net maui and the new blazor webview as the basis for our mobile device app. This way we can move the server engine code to the client (it´s fairly light weight), actually reuse most if not all of our current javascript code and css and keep developing the two platforms (web and mobile app) in parallell.
The one issue we are facing right now is that our app can change at any time. Using a web GUI our administrators can alter the contents of the app, including text, images, sound files and also other content. Our idea was to simply download the new/changed content and store on device and then the webview should be able to use it offline as well. Text content is easy but we can´t quite figure out how to do this for images and audio/video though. It seems the blazor webview is locked into only displaying content from the wwwroot assets folder, which would be fine except we can´t really add content to that folder after deploying the app (as far as we have figured out at least). So my question is what is the best way to handle something like this? Ideally I would like to be able to change where the webview is looking for content to a directory that we can write to (we are able to write files in some kind of file system, just not the assets/resources which are part of the app package). One solution we could use (for images at least) is to set the source to base64encodings of the images, that way we can load the encodings from disk but it seems kind of hackish and also not really an option for sound and video.
So what would be the best way forward here?
Base64encoded images and audio/video only when online? Preload the images (and possibly videos) in the webview (but hidden) and rely on the webview to cache them for offline viewing? (can we force offline caching of them?) Is it possible to make the webview look into a folder we can write to?
If anything is unclear the comment and I´ll be glad to try and explain it better...