Browse SDKs · iOS
Platform
SDKsiOSEnterprise

Delete a conversation group

Delete a conversation group with Open_im_sdkDeleteConversationGroup.

Copy

Invoke Open_im_sdkDeleteConversationGroup to delete a specified conversation group and its member associations. This operation only removes the group categorization; it does not delete any underlying conversations or chat messages:

Parameters

ParameterTypeRequiredDescription
conversationGroupIDNSString *YesTarget conversation group ID to delete.

Code example

#import <OpenIMSDK/CallbackProxy.h>
@import OpenIMCore;

CallbackProxy *callback = [[CallbackProxy alloc]
    initWithOnSuccess:^(NSString * _Nullable data) {
        [self removeConversationGroupByID:@"group_work_101"];
    }
    onFailure:^(NSInteger code, NSString * _Nullable message) {
        NSLog(@"DeleteConversationGroup failed: %ld %@", (long)code, message);
    }];

Open_im_sdkDeleteConversationGroup(callback, @"group_work_101");

Return value

The onSuccess callback returns confirmation when the conversation group is successfully deleted.

State changes after the call

  1. Local state removal: The client removes the group record keyed by conversationGroupID from local storage and group navigation interfaces.
  2. Event notification: Other connected client sessions receive notification through the onConversationGroupDeleted: listener callback.
  3. Data preservation: Deleting a group does not affect conversations or historical chat history. For listener lifecycle details, refer to Conversation groups overview.