Class
V2TIMMessage
public class V2TIMMessage
Definition of V2TIMMessage
Initializers
init()
public init()
Properties
description
public var description: String
friendRemark
public var friendRemark: String?
Sender's friend remark. If friend information has not been pulled or the user is not a friend, nil will be returned.
nameCard
public var nameCard: String?
Get the message sender's alias in the group (valid for group messages)
groupID
public var groupID: String?
Get the groupID. If the message is not a group message, nil will be returned.
userID
public var userID: String?
Get the ID of the other user for one-to-one messages (whether sent by the local or remote user). For group messages, nil will be returned.
seq
public var seq: UInt
Sequence number of the message
Message sequence numbers in group chats are generated in the cloud and are strictly incremented and unique within the group. Message sequence numbers in one-to-one chats are generated locally and are not necessarily strictly incremented or unique.
isPeerRead
public var isPeerRead: Bool
Whether the message was read by the other user(valid only for one-to-one messages). "true" will be returned if the message timestamp is equal to or smaller than the timestamp when the other user marked the message as read.
needReadReceipt
public var needReadReceipt: Bool
Set whether to enable read receipts
-
For group chats, read receipts are supported in 6.1 and later versions. You need to go to the Chat console to set the group types that support the feature first.
-
For one-to-one chats, the feature is supported in 6.2 and later versions.
-
The feature is only available in the Premium Edition.
supportMessageExtension
public var supportMessageExtension: Bool
Set whether to enable message extension (supported only in Chat Premium 6.7 and later versions)
-
You need to configure message extension in the Chat console first. AVChatRoom groups do not support this feature.
-
You need to buy Premium Edition to use this feature.
isBroadcastMessage
public var isBroadcastMessage: Bool
Whether the message is a broadcast message (supported only for AVChatRoom groups in Chat Premium v6.5 or later)
priority
public var priority: V2TIMMessagePriority
Message priority (valid only for the message of the onRecvNewMessage callback)
groupAtUserList
public var groupAtUserList: Array<String>?
UserID list of users who has been @ in the group message
textElem
public var textElem: V2TIMTextElem?
Get the content of a text message (V2TIM_ELEM_TYPE_TEXT)
customElem
public var customElem: V2TIMCustomElem?
Get the content of a custom message (V2TIM_ELEM_TYPE_CUSTOM)
imageElem
public var imageElem: V2TIMImageElem?
Get the content of an image message (V2TIM_ELEM_TYPE_IMAGE)
soundElem
public var soundElem: V2TIMSoundElem?
Get the content of a voice message (V2TIM_ELEM_TYPE_SOUND)
videoElem
public var videoElem: V2TIMVideoElem?
Get the content of a video message (V2TIM_ELEM_TYPE_VIDEO)
fileElem
public var fileElem: V2TIMFileElem?
Get the content of a file message (V2TIM_ELEM_TYPE_FILE, fileElem)
locationElem
public var locationElem: V2TIMLocationElem?
Get the content of a location message (V2TIM_ELEM_TYPE_LOCATION)
faceElem
public var faceElem: V2TIMFaceElem?
Get the content of an emoji message (V2TIM_ELEM_TYPE_FACE)
mergerElem
public var mergerElem: V2TIMMergerElem?
Get the content of a forwarded message (V2TIM_ELEM_TYPE_MERGER)
groupTipsElem
public var groupTipsElem: V2TIMGroupTipsElem?
Get the content of a group tip message (V2TIM_ELEM_TYPE_GROUP_TIPS)
localCustomData
public var localCustomData: Data?
Custom message data. The data is saved locally and will not be sent. It will be lost after the app is reinstalled.
localCustomInt
public var localCustomInt: Int
Custom message data. The data is saved locally and will not be sent. It will be lost after the app is reinstalled.
cloudCustomData
public var cloudCustomData: Data?
Cloud custom data. The data is saved in the cloud and will be sent. It can be pulled even after the app is reinstalled.
isExcludedFromUnreadCount
public var isExcludedFromUnreadCount: Bool
Set or get whether to exclude the message from the unread message count. false (default): included in the unread message count; true: excluded from the unread message count
Supported only in 5.3.425 and later versions and not supported by meeting groups by default
isExcludedFromLastMessage
public var isExcludedFromLastMessage: Bool
Set whether to skip the message when determining the conversation's lastMessage. false (default): do not skip; true: skip
Supported only in 5.4.666 and later versions.
isExcludedFromContentModeration
public var isExcludedFromContentModeration: Bool
Set whether to exclude the current message from content moderation (cloud moderation). The default value is false.
Works only if cloud moderation is enabled. [Cloud moderation] please refer to document [cloud moderation function](https://cloud.tencent.com/document/product/269/83795#.E4.BA.91.E7.AB.AF.E5.AE.A1 .E6.A0.B8.E5.8A.9F.E8.83.BD) Supported only in 7.1 and later versions.
customModerationConfigurationID
public var customModerationConfigurationID: String?
Message custom moderation configuration (supported in 7.8 and later versions and valid only if cloud moderation is enabled)
You can go to the console (On-cloud moderation -> Moderation configuration -> Custom configuration -> Add custom configuration) to get the configuration ID.
hasRiskContent
public var hasRiskContent : Bool
Whether the current message is identified as risk message (supported only in 7.4 and later versions)
This feature is only supported for voice and video messages. This API works only if cloud moderation is enabled. If a voice or video message sent is non-compliant, the onRecvMessageModified callback will be triggered, and the "hasRiskContent()" field in the callback message will be "true".
disableCloudMessagePreHook
public var disableCloudMessagePreHook: Bool
Whether to disable the cloud message hook before sending(supported only in imsdk 8.1 and later versions)
disableCloudMessagePostHook
public var disableCloudMessagePostHook: Bool
Whether to disable the cloud message hook after sending(supported only in imsdk 8.1 and later versions)
offlinePushInfo
public var offlinePushInfo: V2TIMOfflinePushInfo?
Offline push information of the message
revokerInfo
public var revokerInfo: V2TIMUserFullInfo?
Revoker's info (supported only in imsdk 7.4 and later versions)
Valid only for revoked message
revokeReason
public var revokeReason: String?
Revoke reason (supported only in imsdk 7.4 and later versions)
Valid only for revoked message
pinnerInfo
public var pinnerInfo: V2TIMGroupMemberFullInfo?
Pinner's info (supported only in imsdk 8.0 and later versions)
This field is only present in the pinned messages obtained through the GetPinnedGroupMessageList API