Skip to content
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

HybridWebView is official in .NET MAUI 9! 🥳 #70

Open
Eilon opened this issue Jul 20, 2024 · 3 comments
Open

HybridWebView is official in .NET MAUI 9! 🥳 #70

Eilon opened this issue Jul 20, 2024 · 3 comments

Comments

@Eilon
Copy link
Owner

Eilon commented Jul 20, 2024

Hello everyone and thank you for your patience!

As of July 18, 2024, the initial version of the official HybridWebView control is part of .NET MAUI in .NET 9 from this PR: dotnet/maui#22880. It will be available in the upcoming .NET 9 Preview 7 release.

That PR has only the most basic functionality, and more is being worked on now. The list of issues and PRs under consideration is available here: https://github.com/dotnet/maui/labels/area-controls-hybridwebview

Some names, designs, patterns, and behaviors will be different in the official version compared to the experimental version that is in this repo. This is in large part because a lot of the code in this repo was written for the purpose of being an experiment with rapid iteration, as opposed to thinking about long-term requirements.

Please share your thoughts in the .NET MAUI repo at https://github.com/dotnet/maui/issues or within any of the relevant HybridWebView issues/PRs regarding the official version.

And I'd also like to thank everyone here for the feedback, testing, code contributions, and bug reports. It really did make a difference and was a large factor in deciding to make the control an official supported feature.

@Eilon Eilon pinned this issue Jul 20, 2024
@Eilon Eilon changed the title HybridWebView is official in .NET MAUI 9! HybridWebView is official in .NET MAUI 9! 🥳 Jul 20, 2024
@jonmdev
Copy link

jonmdev commented Jul 20, 2024

Great news. Fantastic component that performs at least 3 integral functions in my major app I am developing. Thanks for this and happy to hear it is part of the main official MAUI for future proofing. 🙂💪

@rbrundritt
Copy link
Contributor

Awesome! Love it. Hope we can get some of the newer additions into there eventually.

@nine-2-five
Copy link

nine-2-five commented Sep 27, 2024

This doesn't work for me in MAUI 9 Preview(NET SDK 9.0.100-rc.1.24452.12):
No exception, nothing happens.

double lat = location.Latitude;
double lng = location.Longitude;

var ret = await hybridWebView.InvokeJavaScriptAsync<double>("updateLocation", WbJsContext.Default.Double, [lat, lng], [WbJsContext.Default.Double, WbJsContext.Default.Double]);
Console.WriteLine(ret);
 <script>
     window.addEventListener(
         "HybridWebViewMessageReceived",
         function (e) {
             var messageFromCSharp = document.getElementById("messageFromCSharp");
             messageFromCSharp.value += '\r\n' + e.detail.message;
         });

     function updateLocation(lat, lng) {
         //alert(`received lat:${lat} lng:${lng} from c#, displaying`);     
         var messageFromCSharp = document.getElementById("messageFromCSharp");
         messageFromCSharp.value += '\r\n' + lat;

         return 0;
     }
 </script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants