Pub Sub Publish Options
Decides who receives a message and whether late joiners still see it. Pass one to Room.PubSub.publish; passing none broadcasts the message to every subscriber and keeps nothing.
val options = PubSubPublishOptions(persist = true, sendOnly = arrayOf(hostId))
room.pubSub.publish("CHAT", "hello", options)Content copied to clipboard
Parameters
persist
true stores the message on the server, so anyone who subscribes to the topic later receives it on PubSubMessageListener.onOldMessagesReceived. false, the default, delivers it once to whoever is subscribed right now.
send Only
delivers the message only to these participant ids. null, the default, and an empty array both broadcast to every subscriber.