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

Properties

V2TIMConversationType type
 
NSString * conversationID
 
NSString * userID
 
NSString * groupID
 
NSString * groupType
 
NSString * showName
 
NSString * faceUrl
 
int unreadCount
 
V2TIMReceiveMessageOpt recvOpt
 
V2TIMMessagelastMessage
 
NSArray< V2TIMGroupAtInfo * > * groupAtInfolist
 
NSString * draftText
 
NSDate * draftTimestamp
 
BOOL isPinned
 
NSUInteger orderKey
 

Property Documentation

◆ type

- (V2TIMConversationType) type
readnonatomicassign

Conversation type.

◆ conversationID

- (NSString*) conversationID
readnonatomicstrong

Unique ID of a conversation. 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").

◆ userID

- (NSString*) userID
readnonatomicstrong

If the conversation type is one-to-one chat, the userID stores the user ID of the peer; otherwise, the userID is nil.

◆ groupID

- (NSString*) groupID
readnonatomicstrong

If the conversation type is group chat, the groupID stores the current group ID; otherwise, the groupID is nil.

◆ groupType

- (NSString*) groupType
readnonatomicstrong

Group type of a conversation (valid for group conversations only)

◆ showName

- (NSString*) showName
readnonatomicstrong

Display name of a conversation. Conversation display name priorities are as follows:

  • Group: group name
  • One-to-one: peer's remarks -> peer's nickname -> peer's userID

◆ faceUrl

- (NSString*) faceUrl
readnonatomicstrong

Conversation display profile photo.

  • Group: group profile photo
  • One-to-one: peer's profile photo

◆ unreadCount

- (int) unreadCount
readnonatomicassign

Count of unread messages in a conversation.

◆ recvOpt

- (V2TIMReceiveMessageOpt) recvOpt
readnonatomicassign

Message receiving option for a conversation (Receive | Receive but not notify | Not receive)

◆ lastMessage

- (V2TIMMessage*) lastMessage
readnonatomicstrong

Last message of a conversation

Attention
For versions earlier than 5.5.892, please use "lastMessage -> timestamp" to sort conversations. The later the timestamp, the higher the order of the conversation.

◆ groupAtInfolist

- (NSArray<V2TIMGroupAtInfo *>*) groupAtInfolist
readnonatomicstrong

@ information list in a group conversation, which is used to display "someone@me" or "@All" notifications

◆ draftText

- (NSString*) draftText
readnonatomicstrong

Draft information, please call setConversationDraft() API to set draft information.

◆ draftTimestamp

- (NSDate*) draftTimestamp
readnonatomicstrong

Time stamp of draft information.

◆ isPinned

- (BOOL) isPinned
readnonatomicassign

Whether to pin on top.

◆ orderKey

- (NSUInteger) orderKey
readnonatomicassign

orderKey (supported only in 5.5.892 and later)

Attention
  • The sorting field orderKey is a number that increases linearly according to the conversation activation time (note: this is not a timestamp because multiple conversations may be activated at the same time).
  • For 5.5.892 and later versions, it is recommended that you use this field to sort all conversations. The larger the orderKey value, the higher the order of the conversation.
  • When you clear all messages in a conversation at a time or delete all messages in the conversation one by one, the lastMessage of the conversation becomes empty, but the orderKey of the conversation will not change. In that case, if you want to keep the sorting positions of conversations unchanged, you can use this field to sort all conversations.