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

Send typing indicators to other members

If the startTyping() and endTyping() methods are called while the current user is typing a message in a group channel, channelDidUpdateTypingStatus(_:) in the channel delegate will be invoked on all channel members' devices except the one that belongs to the current user.

channel.startTyping()
channel.endTyping()

// To listen to an update from other channel members' client app,
// implement the channelDidUpdateTypingStatus() function
// with actions to perform when notified.
class GroupChannelChattingViewController: UIViewController, GroupChannelDelegate {
    func initViewController() {
        SendbirdChat.add(self as GroupChannelDelegate, identifier: UNIQUE_DELEGATE_ID)
    }

    func channelDidUpdateTypingStatus(_ channel: GroupChannel) {
        if channel.channelURL == self.channel?.channelURL {
            let members = channel.getTypingUsers()

            // Refresh the typing status of channel members.
        }
    }
}