subscribe

fun subscribe(topic: String, callback: (result: SubscriptionResult) -> Unit): Int

Subscribe to a topic.

Return

the reference ID of the subscription

Parameters

topic

the name of the topic to subscribe to

callback

the callback to trigger when the subscription is called