Skip to content

Instantly share code, notes, and snippets.

@berkus
Created March 20, 2018 12:38
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 berkus/46f6997b3015f64a79054728198f7b42 to your computer and use it in GitHub Desktop.
Save berkus/46f6997b3015f64a79054728198f7b42 to your computer and use it in GitHub Desktop.
Twilio Chat SDK channel handling
class ClientListener : ChatClientListener {
override fun onChannelSynchronizationChange(channel: Channel) {
// Join channel first to trigger synchronization
if (channel.status == Channel.SynchronizationStatus.ALL) { // Channel is fully synchronized
channel.members // not null
}
}
}
chatClient.setListener(ClientListener())
chatClient.channels.join("MyChannel", successListener)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment