//connection return true
var connection = await c.Open();
await c.Controller("mycontroller").Publish("chatmessage", new { Text = "Hello people!" });
I want publish message from my xamarin android client, to my server
public void ChatMessage(string message)
{
this.InvokeToAll(message, "chatmessage");
}
but my message is not sent to the server
server console on server is exist, but does not go in method
Thanks
The issue is that you sent a object with the property Text
However, on the server side you expect the message to be a string
So the fix is to send what you expect (or use a dynamic on the server side).
Example 1 - Sending strings
Server:
Client:
Result:
Example 2 - Sending object
Server:
Client:
Result
Complete Code Sample
Just wrote everything in a single console application with both client and server installed.