Browse SDKs · iOS
Platform
SDKsiOS

Reset group-mention state

Reset a conversation’s group-mention state to normal with OpenIM iOS SDK.

Copy

Invoke resetConversationGroupAtType:onSuccess:onFailure: to reset the @ mention alert state of a specified group conversation to normal after the user has viewed or handled mention messages:

Parameters

ParameterTypeRequiredDescription
conversationIDNSString *YesTarget group conversation ID.

Code example

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

Return value

The onSuccess callback returns confirmation when the operation succeeds.

State changes after the call

  1. Local state update: The conversation's groupAtType property is reset to normal (OIMGroupAtTypeNormal), clearing any special @ mention badge or indicator on the conversation item.
  2. Event notification: Updated conversation properties are broadcast via the onConversationChanged: delegate callback. Match conversations by conversationID to refresh list presentation.
  3. Re-query calibration: Group @ mention status is independent from message read status. If the local cache needs verification, call getConversationsWithIDs:onSuccess:onFailure: or re-query the conversation list. To mark messages as read, refer to Mark a conversation as read. For conversation listener setup, refer to Retrieve conversation list.