IMSDK
IM features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication. It also provides complete app access and backend management APIs.
<V2TIMConversationListener>

Instance Methods

(void) - onSyncServerStart
 
(void) - onSyncServerFinish
 
(void) - onSyncServerFailed
 
(void) - onNewConversation:
 
(void) - onConversationChanged:
 
(void) - onConversationDeleted:
 
(void) - onTotalUnreadMessageCountChanged:
 
(void) - onUnreadMessageCountChangedByFilter:totalUnreadCount:
 
(void) - onConversationGroupCreated:conversationList:
 
(void) - onConversationGroupDeleted:
 
(void) - onConversationGroupNameChanged:newName:
 
(void) - onConversationsAddedToGroup:conversationList:
 
(void) - onConversationsDeletedFromGroup:conversationList:reason:
 
(void) - onConversationsDeletedFromGroup:conversationList:
 

Method Documentation

◆ onSyncServerStart()

- (void) onSyncServerStart
optional

The SDK started to synchronize server conversations. The SDK automatically synchronizes server conversations after a successful login or network reconnection. You can monitor this event and display information about the progress on the UI.

◆ onSyncServerFinish()

- (void) onSyncServerFinish
optional

Server conversations have been synchronized. If a conversation changes, the SDK will notify you via onNewConversation or onConversationChanged.

◆ onSyncServerFailed()

- (void) onSyncServerFailed
optional

Server conversation synchronization failed

◆ onNewConversation:()

- (void) onNewConversation: (NSArray< V2TIMConversation * > *)  conversationList
optional

A new conversation was added. This occurs when, for example, the user received a one-to-one chat message from a new colleague or was added to a new group. You can resort conversations based on "orderKey".

◆ onConversationChanged:()

- (void) onConversationChanged: (NSArray< V2TIMConversation * > *)  conversationList
optional

The key information of some conversations changed. This occurs when, for example, the unread message count of a conversation changes or the last message is updated. You can resort conversations based on "orderKey".

◆ onConversationDeleted:()

- (void) onConversationDeleted: (NSArray< NSString * > *)  conversationIDList
optional

Conversations are deleted. (supported by 7.2 and later versions)

Attention
conversationIDList indicates the deleted conversations' unique IDs. For one-to-one chats, the value format is [NSString stringWithFormat:"c2c_%",userID], "userID"). For group chats, the value format is [NSString stringWithFormat:"group_%",groupID].

◆ onTotalUnreadMessageCountChanged:()

- (void) onTotalUnreadMessageCountChanged: (UInt64)  totalUnreadCount
optional

Notify the changes of the total unread message count of all conversations (supported by 5.3.425 and later versions)

Attention
  • After you call getTotalUnreadMessageCount to obtain the total number of unread messages for all conversations, the newest value will be notified to you through this callback when unread message count of any conversation changed.
  • The total unread message count excludes the unread message count of muted conversations (conversations whose message receiving option is V2TIM_NOT_RECEIVE_MESSAGE or V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE or V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE_EXCEPT_AT).

◆ onUnreadMessageCountChangedByFilter:totalUnreadCount:()

- (void) onUnreadMessageCountChangedByFilter: (V2TIMConversationListFilter *)  filter
totalUnreadCount: (UInt64)  totalUnreadCount 
optional

Notify the changes of the total unread message count of conversations by filter (supported by 7.0 and later versions)

Attention
  • You can call subscribeUnreadMessageCountByFilter to monitor the total unread message count of specified conversations. When the count changes, the SDK will send you the new count via this callback.
  • The filter parameter in this callback is the same as the filter you specify when calling subscribeUnreadMessageCountByFilter. It includes three fields: conversationType, conversationGroup, and markType. If you have specified multiple filters, you can tell which conversations' unread message count has changed based on the three fields from the callback you receive.
  • The total unread message count excludes the unread message count of muted conversations (conversations whose message receiving option is V2TIM_NOT_RECEIVE_MESSAGE or V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE or V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE_EXCEPT_AT).

◆ onConversationGroupCreated:conversationList:()

- (void) onConversationGroupCreated: (NSString *)  groupName
conversationList: (NSArray< V2TIMConversation * > *)  conversationList 
optional

Conversation group has been created.

◆ onConversationGroupDeleted:()

- (void) onConversationGroupDeleted: (NSString *)  groupName
optional

Conversation group has been deleted.

◆ onConversationGroupNameChanged:newName:()

- (void) onConversationGroupNameChanged: (NSString *)  oldName
newName: (NSString *)  newName 
optional

Conversation group name has been chaned.

◆ onConversationsAddedToGroup:conversationList:()

- (void) onConversationsAddedToGroup: (NSString *)  groupName
conversationList: (NSArray< V2TIMConversation * > *)  conversationList 
optional

New conversations have been added to this conversation group.

◆ onConversationsDeletedFromGroup:conversationList:reason:()

- (void) onConversationsDeletedFromGroup: (NSString *)  groupName
conversationList: (NSArray< V2TIMConversation * > *)  conversationList
reason: (uint32_t)  reason 
optional

Conversations have been deleted from this conversation group.

Attention
  • reason : Indicates the reason why the conversation was deleted from the conversation group, its values are:
  • When reason is 0, it means that it is triggered by the user actively calling deleteConversationsFromGroup.
  • When reason is 1, it means that the number of conversations added to the conversation group exceeds 1000, and the earliest conversation added to the group will be eliminated.

◆ onConversationsDeletedFromGroup:conversationList:()

- (void) onConversationsDeletedFromGroup: (NSString *)  groupName
conversationList: (NSArray< V2TIMConversation * > *)  conversationList 
optional

Conversations have been deleted from this conversation group.(This API will be deprecated. Please call onConversationsDeletedFromGroup:conversationList:reason: instead)