/ SDKs / Android
SDKs
Chat SDKs Android v4
Chat SDKs Android
Chat SDKs
Android
Version 4

Invite users as members

Copy link

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.