Browse SDKs · iOS
Platform
SDKsiOS

Hide a conversation

Hide a conversation from the current account’s list without deleting a relationship or group.

Copy

Invoke hideConversation:onSuccess:onFailure: to temporarily hide a conversation entry from the chat list without removing friend relations, leaving groups, or clearing message history:

Parameters

ParameterTypeRequiredDescription
conversationIDNSString *YesTarget conversation ID to hide.

Code example

[[OIMManager manager] hideConversation:@"c2c_user1002"
                             onSuccess:^(NSString * _Nullable data) {
                                 NSLog(@"hideConversation success");
                             }
                             onFailure:^(NSInteger code, NSString *message) {
                                 NSLog(@"hideConversation failed: %ld %@", (long)code, message);
                             }];

Return value

The onSuccess callback returns confirmation when the operation succeeds.

State changes after the call

  1. Local state removal: The client can immediately remove the conversation row corresponding to conversationID from the active conversation list display.
  2. Persistence and reappearance: Stored messages and relationship states are retained. When a new message arrives for this conversation or during an incremental synchronization, the conversation automatically reappears in the list.
  3. Re-query calibration: To hide all conversations at once for the current account, refer to Hide all conversations. For conversation listener setup, refer to Retrieve conversation list.