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

Clear the chat history in a group channel

By using the resetMyHistory() method, you can help the current user clear the chat history in a group channel and start a fresh conversation with other members in the same channel. As the method's name implies, the chat history will be cleared only from the channel view of the current user, and will no longer be shown in that view. But the messages aren't deleted from the database of the Sendbird system, and other members can still see all the messages in their channel views.

This method simply clears the messages for the user by updating the lastMessage and messageOffsetTimestamp properties of a group channel object in addition to other internally managed data such as the number of the user’s unread message.

groupChannel.resetMyHistory { e ->
    if (e != null) {
        // Handle error.
    }

    // ...
}