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:
 

Method Documentation

◆ onSyncServerStart()

- (void) onSyncServerStart
optional

When server conversation synchronization starts, the SDK automatically synchronizes server conversations after a successful login or network reconnection. You can monitor such an event and display the event progress on the UI.

◆ onSyncServerFinish()

- (void) onSyncServerFinish
optional

When server conversation synchronization is completed, if there are conversation changes, the SDK notifies users of the changes via onNewConversation or onConversationChanged callback.

◆ onSyncServerFailed()

- (void) onSyncServerFailed
optional

Server conversation synchronization failed

◆ onNewConversation:()

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

If there is a new conversation (such as receiving a one-to-one chat message from a new colleague or being added to a new group), use "lastMessage -> timestamp" to sort the conversation list again.

◆ onConversationChanged:()

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

If the key information of some conversations changes (for example, the unread count changes, or the last message is updated), use "lastMessage -> timestamp" to sort the conversation list again.

◆ onConversationDeleted:()

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

Notify conversations are deleted (supported by 7.2 and later versions)

Attention
conversationIDList indicates the list of deleted conversation 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 Do-Not-Disturb conversations (conversations whose message receiving option is V2TIMMessage.V2TIM_NOT_RECEIVE_MESSAGE or V2TIMMessage.V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE).

◆ 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 listen the changes of total unread message count for conversations by filter, then the SDK will notify you with the latest value through this callback.
  • When you subscribe changing notification for total unread message count with multiple conversation filters, you can distinguish which types of conversations's unread messages count has changed by judging the three fields of conversationType, markType, and conversationGroup specified in the filter parameter.
  • The total unread message count excludes the unread message count of Do-Not-Disturb conversations (conversations whose message receiving option is V2TIMMessage.V2TIM_NOT_RECEIVE_MESSAGE or V2TIMMessage.V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE).

◆ 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:()

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

Conversations have been deleted from this conversation group.