-
-
Save JcMinarro/dcf589ae182c4612bfa460b57678d0d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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