subscribe

fun subscribe(topic: String, listener: PubSubMessageListener)

This method can be used to subscribe to a topic and receive messages via the provided listener.

Code Example:


meeting.pubSub.subscribe("CHAT") { message ->
    Log.d("PubSub", "Received: " + message.getMessage())
}

Parameters

topic

the topic name to subscribe to

listener

the PubSubMessageListener to receive messages on this topic