broadcast

inline suspend fun <T : Any> RealtimeChannel.broadcast(event: String, message: T)(source)

Sends a message to everyone who joined the channel. Can be used even if you aren't connected to the channel.

Parameters

event

the broadcast event. Example: mouse_cursor

message

the message to send as T (can only be something that can be encoded as a JSON object)


inline suspend fun <T : Any> RealtimeChannel.broadcast(event: String, data: ByteArray)(source)

Sends a message to everyone who joined the channel. Can be used even if you aren't connected to the channel. Requires Realtime.Config.vsn to be set to RealtimeProtocolVersion.V2

Parameters

event

the broadcast event. Example: mouse_cursor

data

the binary data to send