question

SandeepVaidya-0414 avatar image
1 Vote"
SandeepVaidya-0414 asked 73897394 commented

Xamarin Mac application - Calling C# code from the WebView event or through Javascript

I have a requirement to call back C# code from the Javascript of the Html loaded on the WebView. I used the customize WebView code to add additional method to register call back which is working fine on Windows, however the same code is not working in Macintosh application.

Do we need to do any specific changes to make it work fine on Macintosh platform as well?

dotnet-xamarin
· 7
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.

Could you share a demo that could reproduce this issue? Do you use custom-renderer to achieve the calling C# code? You add tag is Xamarin.Forms contains three platforms, Android, UWP and iOS, do not contains Xamarin.Mac.


0 Votes 0 ·

Unfortunately there is a limit of 1000 characters and it is not letting me paste the source code here. I am using the standard method of customizing the webview.

We have used the method given in the below URL.

https://geeks.ms/xamarinteam/2019/02/28/interact-with-javascript-from-c-using-xamarin-forms/

They have given method for every platform except the Macintosh. Method given for IOS is not working for Mac.

0 Votes 0 ·

Unfortunately there is a limit of 1000 characters and it is not letting me paste the source code here. I am using the standard method of customizing the webview.

You can post code in answer or upload your demo to github,

0 Votes 0 ·
Show more comments

Did you find a solution?

0 Votes 0 ·

0 Answers