logo
In-app Chat
SDK Error Codes
On this page

Delete conversations


Introduction

ZIM supports users to delete a specific conversation or all conversations in the conversation list.

Delete a conversation

To delete a specified conversation after login, call the deleteConversation with the conversationID parameter.

Then, developers can obtain the result of the deletion through ZIMConversationDeletedCallback.

Note
title
// Delete a specified conversation.
ZIMConversationDeleteConfig *config = [[ZIMConversationDeleteConfig alloc] init];
config.isAlsoDeleteServerConversation = YES;
[self.zim deleteConversation:@"CONV_ID" conversationType: ZIMConversationTypePeer config:config callback:^(ZIMError * _Nonnull errorInfo) {
    // The results of delete a specified result. 
    if(errorInfo.code == ZIMErrorCodeSuccess) {
      // ......
    } else {
      // ......
    }
}];
1
Copied!

Delete all conversations

After the login, a user can delete all conversations in the conversation list by calling the deleteAllConversationsWithConfig interface.

Afterward, developers can obtain the result of the deletion through ZIMConversationsAllDeletedCallback.

Note

When a user logs in from multiple devices, only the client that initiates the deletion will receive ZIMConversationsAllDeletedCallback. Other online clients that need to synchronize the deletion event should refer to Multi-device login - Delete all server conversations.

Untitled
// Delete all conversations

ZIMConversationDeleteConfig *config = [[ZIMConversationDeleteConfig alloc] init];
config.isAlsoDeleteServerConversation = YES;

[self.zim deleteAllConversationsWithConfig:config callback:^(ZIMError * _Nonnull errorInfo) {
    // Get the result of deleting conversations
    if(errorInfo.code == ZIMErrorCodeSuccess) {
      // ......
    } else {
      // ......
    }
}];
1
Copied!

Previous

Mute a conversation

Next

Pin a conversation