question

Max951-0902 avatar image
0 Votes"
Max951-0902 asked RobCaplan edited

Xamarin Mac call C# from Javascript

I have a requirement to call back C# code from the Javascript of the Html loaded on the WebView.
I know about this https://docs.microsoft.com/en-us/answers/questions/384194/xamarin-mac-application-calling-c-code-from-the-we.html
But I can't found any real and working example for Xamarin Mac

dotnet-csharpdotnet-xamarin
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I'm not aware of an example of this for Mac. You could take the base of the HybridWebView sample and add your own Mac custom renderer. I suspect a Mac version will be very similar to the iOS version, so I'd start with that.

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/hybridwebview
https://github.com/xamarin/xamarin-forms-samples/tree/main/CustomRenderers/HybridWebView/iOS

0 Votes 0 ·

0 Answers