SDKsiOS
Hide a conversation
Hide a conversation from the current account’s list without deleting a relationship or group.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | NSString * | Yes | Target 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
- Local state removal: The client can immediately remove the conversation row corresponding to
conversationIDfrom the active conversation list display. - 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.
- 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.
Was this page helpful?