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.
V2TIMConversationListenerabstract

Public Member Functions

void onSyncServerStart ()
 
void onSyncServerFinish ()
 
void onSyncServerFailed ()
 
void onNewConversation (List< V2TIMConversation > conversationList)
 
void onConversationChanged (List< V2TIMConversation > conversationList)
 
void onConversationDeleted (List< String > conversationIDList)
 
void onTotalUnreadMessageCountChanged (long totalUnreadCount)
 
void onUnreadMessageCountChangedByFilter (V2TIMConversationListFilter filter, long totalUnreadCount)
 
void onConversationGroupCreated (String groupName, List< V2TIMConversation > conversationList)
 
void onConversationGroupDeleted (String groupName)
 
void onConversationGroupNameChanged (String oldName, String newName)
 
void onConversationsAddedToGroup (String groupName, List< V2TIMConversation > conversationList)
 
void onConversationsDeletedFromGroup (String groupName, List< V2TIMConversation > conversationList)
 

Member Function Documentation

◆ onSyncServerStart()

void onSyncServerStart ( )
inline

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 ( )
inline

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 ( )
inline

Server conversation synchronization failed

◆ onNewConversation()

void onNewConversation ( List< V2TIMConversation conversationList)
inline

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.

Parameters
conversationListConversation list

◆ onConversationChanged()

void onConversationChanged ( List< V2TIMConversation conversationList)
inline

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.

Parameters
conversationListConversation list

◆ onConversationDeleted()

void onConversationDeleted ( List< String >  conversationIDList)
inline

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 String.format("c2c_%s", "userID"). For group chats, the value format is String.format("group_%s", "groupID").

◆ onTotalUnreadMessageCountChanged()

void onTotalUnreadMessageCountChanged ( long  totalUnreadCount)
inline

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

void onUnreadMessageCountChangedByFilter ( V2TIMConversationListFilter  filter,
long  totalUnreadCount 
)
inline

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

void onConversationGroupCreated ( String  groupName,
List< V2TIMConversation conversationList 
)
inline

Conversation group has been created.

◆ onConversationGroupDeleted()

void onConversationGroupDeleted ( String  groupName)
inline

Conversation group has been deleted.

◆ onConversationGroupNameChanged()

void onConversationGroupNameChanged ( String  oldName,
String  newName 
)
inline

Conversation group name has been changed

◆ onConversationsAddedToGroup()

void onConversationsAddedToGroup ( String  groupName,
List< V2TIMConversation conversationList 
)
inline

New conversations have been added to this conversation group.

◆ onConversationsDeletedFromGroup()

void onConversationsDeletedFromGroup ( String  groupName,
List< V2TIMConversation conversationList 
)
inline

Conversations have been deleted from this conversation group.