Message Player
Last updated
Last updated
Sends messages to another player of your game. Players have to be in the same Lobby region to receive the messages.
SocketWeaver does not have services for managing user profiles. You need to use services like Google Firebase to store SocketWeaver playerIds to use this API. The overview of the workflow is demonstrated in the picture below.
Maximum size of a message data is 4.5KB.
In this example, we are sending a simple string message to the target player.
In this example, we are sending serializable object messages to the target player. You can implemented your own messaging protocol.
Sending a chat message.
Sending a room invite
Methods
Called by players to begin an asynchronous operation to send message to another player using the specified targetPlayerId and string messageData.
Called by players to begin an asynchronous operation to send message to another player using the specified targetPlayerId and serializable object messageData.
Class
The error that occurred when a lobby API operation failed.