-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load local files from FileSystem.Current.AppDataDirectory #71
Comments
Hi @GorillaSpring , can you share more info on what you're trying to do? The |
@Eilon. Thanks for the response. So, we have been in production (iOS and Android) for almost 4 years. I am not "modifying" the app at runtime, I am simply just styling it and hiding / showing features. All of this could be done with native / maui UI. The production app is Xamarin native. (Note, I found forms very frustrating, so just stuck with native). Our workflow: The user installs the app. ** In addition *** The App downloads a bunch of SCORM like courses. These are HTML based courses that are generated with a authoring tool. These can be quite big and a lot of data. The course that are downloaded can vary from user to user quite a bit. To run these, I do need to pass in query strings. As a quick note, we use one view per HTML view. This means that you still get the device navigation feel and features. Each view is essentially just a WebView, however some have other things on it. All this works quite well. The HTML simply calls a JS bridge to communicate with the device. Almost everything works offline, and is synced up to the server as needed and when online. Another quick note. The SAME HTML is used for the UI on our web server (Razor simply loads the div from the HTML). So, being forced to move to MAUI, All I really need is a JSBridge. The other solutions (to hack the Navigated) do not work because of the SCORM like courses. Also, there are race conditions and the iOS browser cancels previous requests. Also, just a really bad hack for something MS should have included prior to dropping support for Xamarin. I am going back to trying to make this work with .net8 : https://github.com/nmoschkin/MAUIWebViewExample So, the reason for my long winded response is to give you an idea of how a hybrid ui may work. One thing that will also come up (think it has in your comments) is if a app uses a resource created on the app and you want to show it. IE, pick a profile picture. I guess you would have to encode it and serve it up though the "proxy". |
As luck would have it I have a solution for this as I ran into a similar requirement a month ago (I needed to be able to load a webpage I had as an embedded resource). I have been pushing the limits of this control and am starting to clean up my workarounds and bring them back here. I just made a pull request that allows the proxy capability to be used with the MainFile. I saw this post just before making the PR, so I added a sample for this specific scenario. Here is the PR: #73 |
@rbrundritt . Thank. I did manage to write my own. @Eilon 's solution was really helpful. I now know more about custom Maui controls then I ever wanted to. When I get a chance (in a few weeks at least), I will put up the solution. It is significantly simpler and works for my requirement. Will also work for server hosted files just fine. |
I download my HTML UI. This is based on configuration for the user. In addition an updated UI can be pushed out.
I need to be able to load html pages from FileSystem.Current.AppDataDirectory
Seems like you cannot write to the "Raw" directory.
If this is way out of scope, any pointers to modifying a fork would be super helpful.
My production platforms are iOS and Android, but I am using windows as a platform during dev.
The text was updated successfully, but these errors were encountered: