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

Properties

NSString * msgID
 
NSDate * timestamp
 
NSString * sender
 
NSString * nickName
 
NSString * friendRemark
 
NSString * nameCard
 
NSString * faceURL
 
NSString * groupID
 
NSString * userID
 
uint64_t seq
 
uint64_t random
 
V2TIMMessageStatus status
 
BOOL isSelf
 
BOOL isRead
 
BOOL isPeerRead
 
BOOL needReadReceipt
 
BOOL supportMessageExtension
 
BOOL isBroadcastMessage
 
V2TIMMessagePriority priority
 
NSMutableArray< NSString * > * groupAtUserList
 
V2TIMElemType elemType
 
V2TIMTextElemtextElem
 
V2TIMCustomElemcustomElem
 
V2TIMImageElemimageElem
 
V2TIMSoundElemsoundElem
 
V2TIMVideoElemvideoElem
 
V2TIMFileElemfileElem
 
V2TIMLocationElemlocationElem
 
V2TIMFaceElemfaceElem
 
V2TIMMergerElemmergerElem
 
V2TIMGroupTipsElemgroupTipsElem
 
NSData * localCustomData
 
int localCustomInt
 
NSData * cloudCustomData
 
BOOL isExcludedFromUnreadCount
 
BOOL isExcludedFromLastMessage
 
BOOL isExcludedFromContentModeration
 
NSString * customModerationConfigurationID
 
BOOL hasRiskContent
 
V2TIMOfflinePushInfoofflinePushInfo
 
V2TIMUserFullInfo * revokerInfo
 
NSString * revokeReason
 

Property Documentation

◆ msgID

- (NSString*) msgID
readnonatomicstrong

Message ID.

◆ timestamp

- (NSDate*) timestamp
readnonatomicstrong

UTC timestamp of the message.

◆ sender

- (NSString*) sender
readnonatomicstrong

Sender's userID.

◆ nickName

- (NSString*) nickName
readnonatomicstrong

Sender's nickname.

◆ friendRemark

- (NSString*) friendRemark
readnonatomicstrong

Sender's friend remark. If you have not pulled the friend information or are not a friend, nil is returned.

◆ nameCard

- (NSString*) nameCard
readnonatomicstrong

For a group message, nameCard is the group name card of the sender.

◆ faceURL

- (NSString*) faceURL
readnonatomicstrong

Sender's profile photo URL.

◆ groupID

- (NSString*) groupID
readnonatomicstrong

For a group message, groupID is the message receiving group ID. Otherwise, groupID is null.

◆ userID

- (NSString*) userID
readnonatomicstrong

For a one-to-one message, userID is the conversation user ID. Otherwise, userID is null. Suppose you are chatting with userA, regardless of whether it is a message sent to userA by yourself or a message sent to yourself by userA, the userID here is userA.

◆ seq

- (uint64_t) seq
readnonatomicassign

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 cannot be guaranteed to be strictly incremented and unique.

◆ random

- (uint64_t) random
readnonatomicassign

Random number of the message.

◆ status

- (V2TIMMessageStatus) status
readnonatomicassign

Message sending status.

◆ isSelf

- (BOOL) isSelf
readnonatomicassign

Whether the message sender is the current user.

◆ isRead

- (BOOL) isRead
readnonatomicassign

Whether the message is read by the current user.

◆ isPeerRead

- (BOOL) isPeerRead
readnonatomicassign

Whether the message is read by the peer party (valid only for one-to-one messages) The condition for this field to be YES is that the message timestamp <= the time when the peer marked conversation as read

◆ needReadReceipt

- (BOOL) needReadReceipt
readwritenonatomicassign

Whether a read receipt is required

Attention

This feature for group chats is supported in 6.1 and later version. And you need to go to the IM console to enable this feature for specific group type.

This feature for one-to-one chats is supported in 6.2 and later version.

You need to buy Premium Edition to use this feature for both group and one-to-one chats.

◆ supportMessageExtension

- (BOOL) supportMessageExtension
readwritenonatomicassign

Whether to support message extension (supported only in 6.7 and later versions)

Attention

AVChatRoom message do not support this feature.

You need to go to the IM console to enable this feature.

You need to buy Premium Edition to use this feature.

◆ isBroadcastMessage

- (BOOL) isBroadcastMessage
readnonatomicassign

Whether the message is a kind of broadcast message Only supported in AVChatRoom Only supported in 6.5 and later versions and need to buy Premium Edition

◆ priority

- (V2TIMMessagePriority) priority
readnonatomicassign

Message priority (valid only for the message of the onRecvNewMessage callback)

◆ groupAtUserList

- (NSMutableArray<NSString *>*) groupAtUserList
readnonatomicstrong

UserID list of users who has been @ in the group message.

◆ elemType

- (V2TIMElemType) elemType
readnonatomicassign

Message type.

◆ textElem

- (V2TIMTextElem*) textElem
readnonatomicstrong

If the message type is V2TIM_ELEM_TYPE_TEXT, textElem stores the content of the text message.

◆ customElem

- (V2TIMCustomElem*) customElem
readnonatomicstrong

If the message type is V2TIM_ELEM_TYPE_CUSTOM, customElem stores the content of the custom message.

◆ imageElem

- (V2TIMImageElem*) imageElem
readnonatomicstrong

If the message type is V2TIM_ELEM_TYPE_IMAGE, imageElem stores the content of the image message.

◆ soundElem

- (V2TIMSoundElem*) soundElem
readnonatomicstrong

If the message type is V2TIM_ELEM_TYPE_SOUND, soundElem stores the content of the voice message.

◆ videoElem

- (V2TIMVideoElem*) videoElem
readnonatomicstrong

If the message type is V2TIM_ELEM_TYPE_VIDEO, videoElem stores the content of the video message.

◆ fileElem

- (V2TIMFileElem*) fileElem
readnonatomicstrong

If the message type is V2TIM_ELEM_TYPE_FILE, fileElem stores the content of the file message.

◆ locationElem

- (V2TIMLocationElem*) locationElem
readnonatomicstrong

If the message type is V2TIM_ELEM_TYPE_LOCATION, locationElem stores the content of the geographical location message.

◆ faceElem

- (V2TIMFaceElem*) faceElem
readnonatomicstrong

If the message type is V2TIM_ELEM_TYPE_FACE, faceElem stores the content of the emoji message.

◆ mergerElem

- (V2TIMMergerElem*) mergerElem
readnonatomicstrong

If the message type is V2TIM_ELEM_TYPE_MERGER, relayElem stores the content of the forward message.

◆ groupTipsElem

- (V2TIMGroupTipsElem*) groupTipsElem
readnonatomicstrong

If the message type is V2TIM_ELEM_TYPE_GROUP_TIPS, groupTipsElem stores the content of the group tip message.

◆ localCustomData

- (NSData*) localCustomData
readwritenonatomicstrong

Local custom message data (saved locally, will not be sent to the peer end, and will become invalid after the app is uninstalled and reinstalled)

◆ localCustomInt

- (int) localCustomInt
readwritenonatomicassign

Local custom message data (saved locally, will not be sent to the peer end, and will become invalid after the app is uninstalled and reinstalled)

◆ cloudCustomData

- (NSData*) cloudCustomData
readwritenonatomicstrong

Cloud custom data (saved in the cloud, will be sent to the peer end, and can still be pulled after the app is uninstalled and reinstalled)

◆ isExcludedFromUnreadCount

- (BOOL) isExcludedFromUnreadCount
readwritenonatomicassign

Whether the message is excluded from the conversation unread message count. NO (default): included in the unread message count of the conversation; YES: excluded from the conversation unread message count

Supported only in 5.3.425 and later versions. Meeting group does not support this field by default.

◆ isExcludedFromLastMessage

- (BOOL) isExcludedFromLastMessage
readwritenonatomicassign

Whether the message is excluded from the conversation lastMessage. NO (default): included in the conversation lastMessage; YES: excluded from the conversation lastMessage Supported only in 5.4.666 and later versions.

◆ isExcludedFromContentModeration

- (BOOL) isExcludedFromContentModeration
readwritenonatomicassign

Specify Whether the current message will be excluded from content moderation (including [Local moderation] and [Cloud moderation]). Its default value is NO. Valid only after the [Local Moderation] or [Cloud Moderation] function is activated. [Local moderation] please refer to document local moderation function. [Cloud moderation] please refer to document cloud moderation function Supported only in 7.1 and later versions.

◆ customModerationConfigurationID

- (NSString*) customModerationConfigurationID
readwritenonatomicstrong

Message custom moderation configuration (supported only in 7.8 and later versions) Valid only after the [Cloud Moderation] function is activated. You can go to the Console (Cloud moderation -> Moderation configuration -> Custom configuration -> Add custom configuration) to get the configuration ID. [Custom moderation] please refer to document cloud moderation function

Attention
This field needs to be set up before sending messages. It is only used to control the the message moderation when sending messages, Its value will not be stored in cloud and local.

◆ hasRiskContent

- (BOOL) hasRiskContent
readnonatomicassign

Whether the current message is identified as risk message (supported only in 7.4 and later versions) Only messages containing sound and video are supported. It will take effect after you enabling the [Cloud Moderation] feature, [Cloud Moderation] please refer to document cloud moderation function. If you send a risky sound or video message, you will receive the onRecvMessageModified callback with this field being set to YES after the cloud moderation.

◆ offlinePushInfo

- (V2TIMOfflinePushInfo*) offlinePushInfo
readnonatomicstrong

Offline push information of the message.

◆ revokerInfo

- (V2TIMUserFullInfo*) revokerInfo
readnonatomicstrong

Revoker's info (supported only in imsdk 7.4 and later versions) Valid only for revoked message

◆ revokeReason

- (NSString*) revokeReason
readnonatomicstrong

Revoke reason (supported only in imsdk 7.4 and later versions) Valid only for revoked message