/ SDKs / iOS
SDKs
Chat SDKs iOS v4
Chat SDKs iOS
Chat SDKs
iOS
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.

var userIds: [String] = []
userIds.append("Tyler")
userIds.append("Young")

channel.inviteUserIds(userIds) { error in
    guard error == nil else {
        // Handle error.
        return 
    }
}

You can also determine whether the newly joined user can see the 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, the newly joined member can view all messages sent before they have joined the channel. If turned off, the new member can only see messages sent after they have been invited. By default, this option is turned on.