heroiclabs / nakama-java

Java client for the Nakama and Satori servers.
https://heroiclabs.com/docs/android-java-client-guide/
Apache License 2.0
33 stars 18 forks source link

How to send data in real time in Java class library like SDK #30

Closed hyb1234hi closed 4 years ago

hyb1234hi commented 4 years ago

We can use JavaScript client exchange data as follows: socket.onchannelmessage = (channelMessage) => { console.info("Received chat message:", channelMessage); };

const channelId = "pineapple-pizza-lovers-room"; var response = await socket.send({ channel_join: { type: 1, // 1 = room, 2 = Direct Message, 3 = Group target: channelId, persistence: false, hidden: false } }); console.info("Successfully joined channel:", response.channel.id);

const messageAck = await socket.send({ channel_message_send: { channel_id: response.channel.id, content: {"message": "Pineapple doesn't belong on a pizza!"} } }); console.info("Successfully sent chat message:", messageAck);

How to send data in real time in Java class library like this.

novabyte commented 4 years ago

@hyb1234hi I think this conversation should be moved to the forums as a question on there. The issue tracker is for errors or problems with the client sdk. Thanks