Chat / iOS
Chat iOS v4
Chat iOS
Chat
iOS
Home
/
Chat
/
iOS
/
Channel
This is the new Docs for Chat SDK v4 for iOS. 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 is not 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 the 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.