Native messaging, OSX

Hello all,

As stated in this stackoverflow thread (https://stackoverflow.com/questions/60158354/cross-browser-cross-platform-native-messaging-using-xamarin-mac-c-sharp?noredirect=1#comment106503752_60158354), I have tried to get native messaging to work with my host (VS Studio, Xamarin app for macOS), but so for nothing.

When I put my application path in the manifest (/…/MyAPP.app/Contents/MacOS/MyApp), I see the application starting, but it stops right away.

I then get the following error:
"
Native application tried to send a message of 543451477 bytes, which exceeds the limit of 1048576 bytes.
"

On Chrome it is the following error:

“Error when communicating with host…”

I know that the terminal version of the app should be opened, which works when opening it by hand, but not through the manifest.

Everything works fine with the example from github (Linux machine at least).

Thanks to provide some guidance, or if possible, code of someone who got it to work on macOS.
Much appreciated.

What happens if you try with a smaller message?

Hi,

Found a solution about the same time I opened this thread.

The thing is that I used examples as a starting point, but they didn’t parsed the first 4 bytes as the length of the message.

Please refer to the Stack overflow thread to see details with my solution.

Thanks anyway.

Also. Please excuse my spelling mistake at the end of the first paragraph within my question. * so far nothing *

1 Like