Replies: 24 comments 31 replies
-
Some quick thoughts/questions:
|
Beta Was this translation helpful? Give feedback.
-
I see https://github.com/tauri-apps/tauri is very hot, what's the difference between them when package an existing web project. |
Beta Was this translation helpful? Give feedback.
-
This is interesting! |
Beta Was this translation helpful? Give feedback.
-
So, with this we can do like Tauri. This is very cool! Thanks! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
And now I am most excited to show how cool a true hybrid app can be! I have integrated an existing React app sample into .NET MAUI! I found a cool React Todo App sample:
I created a fork of it at https://github.com/Eilon/todo-react with 1 additional commit (only 79 new lines; 22 deleted lines) to add calls to get/send data to the .NET MAUI app. This way it can share data and interact with the native platform, for example, by storing the todo items in a database or via a remote API call. You can find the source code for HybridWebView and the two sample apps (the earlier MauiCSharpInteropWebView sample, and the new MauiReactJSHybridApp sample) on my repo: https://github.com/Eilon/MauiCSharpInteropWebView Here's the app running as a proper .NET MAUI hybrid app on Android: And running on Windows: |
Beta Was this translation helpful? Give feedback.
-
support appkit please, cat is with too much problems. |
Beta Was this translation helpful? Give feedback.
-
Can SendInvokeMessageToDotNet implement the return value? |
Beta Was this translation helpful? Give feedback.
-
Is there a way not be 0.0.0.0, but a public url from a web server? I know webview does this, but we need the javascript <-> c# communication :/ |
Beta Was this translation helpful? Give feedback.
-
It would be nice to have a good way of exposing methods to interop. I currently use CefSharp and the way C# can be bound and called is pretty good: https://github.com/cefsharp/CefSharp/wiki/General-Usage#3-how-do-you-expose-a-net-class-to-javascript I don't like having to use method names as strings; I would prefer mocking server API requests. |
Beta Was this translation helpful? Give feedback.
-
I'd like a HybridWebView component so we can build a UI with fsharp using Fable and build platform-native bits with fsharp using dotnet. I'd like this component to expose an unopiniated transport for bidrectional communication between dotnet and javascript that makes it easy for application developers to implement different protocols atop it. For example:
I don't know what this transport abstraction would look like, but I'm looking for something higher level than the various webview's script execution methods (for example, The alternative is each of these examples needs to implement their own HybridWebView component that supports the protocol they like. Footnotes
|
Beta Was this translation helpful? Give feedback.
-
One feature I would like to see is to enable debugging with web DevTools. Lot's of times you need to inject some JS or evaluate some JS and it would be nice to see what is going on in the DOM |
Beta Was this translation helpful? Give feedback.
-
@Eilon I like the Idea of what you did so far. |
Beta Was this translation helpful? Give feedback.
-
@Eilon I found bug HybridWebView can't load image from svg file but can load from png file |
Beta Was this translation helpful? Give feedback.
-
Any update on iOS support? |
Beta Was this translation helpful? Give feedback.
-
Hi! Ellion. Can you give me the way to convert my own react app to hybrid app using hybridwebview. Mine is using sqlite database and I am wondering how I can integrate database in desktop and mobile app. |
Beta Was this translation helpful? Give feedback.
-
Hi @Eilon I just want to say this looks awesome and I hope it becomes a part of MAUI! |
Beta Was this translation helpful? Give feedback.
-
Just wanted to say thank you for this! Much needed if MAUI is to be taken seriously! |
Beta Was this translation helpful? Give feedback.
-
HybridWebView proved very helpful in implementing payment gateway to Maui App. The payment card data should be captured by the payment gateway provider through iframe. I used HybridWebView for embedding the iframe of Payment Gateway. Otherwise I would need a website to do this task which would also deteriorate the user experience. |
Beta Was this translation helpful? Give feedback.
-
Hi @Eilon. I wanted to thank you for creating this webviewer control. I had a question to ask you though, I was wondering if:
|
Beta Was this translation helpful? Give feedback.
-
Hi, I'm trying to figure out how to use the FileSystem.AppDataDirectory as the root folder for a HybridWebView instance. Ideally I'd like to have my html, css, js and image assets in that one folder (or sub-folder). Thanks. |
Beta Was this translation helpful? Give feedback.
-
To be clear, is this work only for local html? Or can i simply put hybridwebview that point to my website and my website detect if hybridwebview request the page and add additional logic that can call native function? |
Beta Was this translation helpful? Give feedback.
-
Will the HybridWebView control provide the possibility to configure the content-type of the root file? In the following code, I can see that the content-type is hard-coded to "text/html". maui/src/Core/src/Handlers/HybridWebView/HybridWebViewHandler.Windows.cs Lines 120 to 124 in 5d22e79 In case of .mhtml, the content-type would be "multipart/related" or "message/rfc822", which is also configured in https://github.com/dotnet/maui/blob/9.0.0-rc.1.24453.9/src/Core/src/Handlers/HybridWebView/FileExtensionContentTypeProvider.cs for related files. |
Beta Was this translation helpful? Give feedback.
-
Hi @Eilon, there are 2 things I want you to clarify please.
Thanks |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, based on ideas from these issues:
I've started an experimental .NET MAUI HybridWebView control. This control is designed to support scenarios where a static web app already exists (for example, a web app that uses HTML, JS, CSS, images, including frameworks such as ReactJS, etc.), and you want to host it in a .NET MAUI cross-platform application for mobile and/or desktop.
The control enables communication between the JS code and the .NET (C#) code using methods and events.
Find the source code and sample app here: https://github.com/Eilon/MauiHybridWebView
Current status (as of September 2023)
Check out the repo with source code and samples here: https://github.com/Eilon/MauiHybridWebView
And packages on NuGet.org: https://www.nuget.org/packages/EJL.MauiHybridWebView
The information below might be out-of-date, but is included for historical purposes.
Important updates (December 22, 2022):
How to use the control
Using the control involves:
Resources/Raw/MyHybridApp
HybridWebView
control in your app, for example in a XAML file:<hwv:HybridWebView HybridAssetRoot="MyHybridApp" MainFile="index.html" MessageReceived="webView_MessageReceived" />
Send messages from .NET to JS
To send messages from .NET (C#) to JS code in the webview:
Send messages from JS to .NET
And to send messages from JS to .NET (C#) you'd have a method like this:
And you'd receive the message in a C# event handler like this:
Feedback
I encourage you to check out the sample app here: https://github.com/Eilon/MauiHybridWebView
And let me know any feedback you have. Does this solve a problem that you have? What else would you like to see? What apps would you build with such a feature?
Beta Was this translation helpful? Give feedback.
All reactions