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

Class V2TIMConversation

public class V2TIMConversation  

Definition of V2TIMConversation

Initializers

init()

public init()  

Properties

description

public var description: String  

type

public var type: V2TIMConversationType  

Conversation type.

conversation​ID

public var conversationID: String  

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").

user​ID

public var userID: String?  

If the conversation is a one-to-one chat, the user ID of the remote user will be returned; otherwise, nil will be returned.

group​ID

public var groupID: String?  

If the conversation is a group chat, the group ID will be returned; otherwise, nil will be returned.

group​Type

public var groupType: String?  

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

show​Name

public var showName: String?  

Get the conversation display name. The priorities are as follows:

  • Group: group name -> group ID

  • One-to-one: Alias -> nickname -> user ID

face​Url

public var faceUrl: String?  

Conversation display profile photo.

  • Group: group profile photo

  • One-to-one: the remote user's profile photo

unread​Count

public var unreadCount: Int  

Count of unread messages in a conversation.

recv​Opt

public var recvOpt: V2TIMReceiveMessageOpt  

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

last​Message

public var lastMessage: V2TIMMessage?  

Last message of a conversation

group​AtInfolist

public var groupAtInfolist: Array<V2TIMGroupAtInfo>?  

Get a list of @ messages. This API can be used to notify a user when they are mentioned or all members are mentioned in a group.

draft​Text

public var draftText: String?  

Get the draft of an unsent message (a draft message is stored locally only and will be lost after the app is reinstalled)

draft​Timestamp

public var draftTimestamp: Date?  

Get the UTC timestamp when the draft was last set

is​Pinned

public var isPinned: Bool  

Whether to pin on top

order​Key

public var orderKey: UInt  

The field by which conversations are sorted (supported only in 5.5.892 and later)

  • The field orderKey is a number that increases linearly according to the last active time of conversations. Please note that this is not a timestamp because multiple conversations may be active at the same time.

  • For 5.5.892 and later versions, it is recommended that you sort all conversations by this field. The larger the orderKey value, the higher a conversation will appear on the list.

  • If all conversation messages are cleared or the messages of each conversation are deleted one by one, the lastMessage of the conversations will become empty, but orderKey will not change. Therefore, if you want to keep the sorting of conversations, you can use this field to sort conversations.

mark​List

public var markList: Array<V2TIMConversationMarkType>?  

Mark list of the conversation(supported only in 6.5 and later versions)

custom​Data

public var customData: Data?  

Custom data of the conversation(supported only in 6.5 and later versions)

conversation​Group​List

public var conversationGroupList: Array<String>?  

The conversation group list to which the conversation belongs.(supported only in 6.5 and later versions)

c2cRead​Timestamp

public var c2cReadTimestamp: UInt?  

UTC timestamp of the latest message which has been read. Valid only for one-to-one chat.(supported only in 7.1 and later versions)

group​Read​Sequence

public var groupReadSequence: UInt?  

Sequence of the latest message which has been read. Valid only for group chat.(supported only in 7.1 and later versions)