Chat / Android
Chat Android v4
Chat Android
Chat
Android
Home
/
Chat
/
Android
/
Channel
This is the new Docs for Chat SDK v4 for Android. To see the previous Docs, click here.

Invite users as members

To enter a private group channel, a user must be invited by members who are already in the group channel. On the other hand, an invitation isn't required to join a public group channel.

val userIds: List<String> = listOf("Tyler", "Young")
groupChannel.invite(userIds) { e ->
    if (e != null) {
        // Handle error.
    }
    // ...
}

You can also determine whether the newly invited user can see past messages in the channel or not. You can manage the settings on Sendbird Dashboard. Go to Settings > Chat > Channels > Group channels, and you will see the Chat history option. If the option is turned on, newly joined members can view all messages sent before they joined the channel. If turned off, new members can only see messages sent after they were invited. By default, this option is turned on.