/ SDKs / iOS
SDKs
Chat SDKs iOS v4
Chat SDKs iOS
Chat SDKs
iOS
Version 4

Send typing indicators to other members

Copy link

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.
        }
    }
}