publish

fun publish(topic: String, message: String, @NonNull payload: JSONObject, options: PubSubPublishOptions)

Publishes a message to the specified topic.

Code Example:


val payload = JSONObject()
payload.put("type", "reaction")
payload.put("emoji", "👍")
val options = PubSubPublishOptions()
meeting.pubSub.publish("REACTIONS", "reaction", payload, options)

Parameters

topic

the topic name to publish the message to

message

the message content to publish

payload

(Optional) additional JSONObject payload to include with the message.

options

the PubSubPublishOptions controlling persistence and other settings