Skip to content

Instantly share code, notes, and snippets.

@JcMinarro
Created May 13, 2020 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JcMinarro/dcf589ae182c4612bfa460b57678d0d7 to your computer and use it in GitHub Desktop.
Save JcMinarro/dcf589ae182c4612bfa460b57678d0d7 to your computer and use it in GitHub Desktop.
val data: Map<String, Any> = mapOf("name" to "The name of the channel")
channelController.query(
QueryChannelRequest()
.withData(data)
.withMessages(100)
.withWatch()
).enqueue {
when (it.isSuccess) {
true -> {
// Channel has been created and we can get it calling to the data() method
val channel: Channel = it.data()
// Inside of the channel, we can find received messages
showMessages(it.data().messages)
}
false -> {
// Something went wrong, we have the error on the error() method
handleError(it.error())
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment