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
 
BOOL disableCloudMessagePreHook
 
BOOL disableCloudMessagePostHook
 
V2TIMOfflinePushInfoofflinePushInfo
 
V2TIMUserFullInfo * revokerInfo
 
NSString * revokeReason
 
V2TIMGroupMemberFullInfo * pinnerInfo
 

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 friend information has not been pulled or the user is not a friend, nil will be returned.

◆ nameCard

- (NSString*) nameCard
readnonatomicstrong

Get the message sender's alias in the group (valid for group messages)

◆ faceURL

- (NSString*) faceURL
readnonatomicstrong

Sender's profile photo URL.

◆ groupID

- (NSString*) groupID
readnonatomicstrong

Get the groupID. If the message is not a group message, nil will be returned.

◆ userID

- (NSString*) userID
readnonatomicstrong

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

- (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 are not necessarily strictly incremented or 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 has been read by the current user.

◆ isPeerRead

- (BOOL) isPeerRead
readnonatomicassign

Whether the message was read by the other user(valid only for one-to-one messages). YES 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

- (BOOL) needReadReceipt
readwritenonatomicassign

Set whether to enable read receipts

Attention

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

- (BOOL) supportMessageExtension
readwritenonatomicassign

Set whether to enable message extension (supported only in Chat Premium 6.7 and later versions)

Attention

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

- (BOOL) isBroadcastMessage
readnonatomicassign

Whether the message is a broadcast message (supported only for AVChatRoom groups in Chat Premium v6.5 or later)

◆ 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

Get the content of a text message (V2TIM_ELEM_TYPE_TEXT)

◆ customElem

- (V2TIMCustomElem*) customElem
readnonatomicstrong

Get the content of a custom message (V2TIM_ELEM_TYPE_CUSTOM)

◆ imageElem

- (V2TIMImageElem*) imageElem
readnonatomicstrong

Get the content of an image message (V2TIM_ELEM_TYPE_IMAGE)

◆ soundElem

- (V2TIMSoundElem*) soundElem
readnonatomicstrong

Get the content of a voice message (V2TIM_ELEM_TYPE_SOUND)

◆ videoElem

- (V2TIMVideoElem*) videoElem
readnonatomicstrong

Get the content of a video message (V2TIM_ELEM_TYPE_VIDEO)

◆ fileElem

- (V2TIMFileElem*) fileElem
readnonatomicstrong

Get the content of a file message (V2TIM_ELEM_TYPE_FILE, fileElem)

◆ locationElem

- (V2TIMLocationElem*) locationElem
readnonatomicstrong

Get the content of a location message (V2TIM_ELEM_TYPE_LOCATION)

◆ faceElem

- (V2TIMFaceElem*) faceElem
readnonatomicstrong

Get the content of an emoji message (V2TIM_ELEM_TYPE_FACE)

◆ mergerElem

- (V2TIMMergerElem*) mergerElem
readnonatomicstrong

Get the content of a forwarded message (V2TIM_ELEM_TYPE_MERGER)

◆ groupTipsElem

- (V2TIMGroupTipsElem*) groupTipsElem
readnonatomicstrong

Get the content of a group tip message (V2TIM_ELEM_TYPE_GROUP_TIPS)

◆ localCustomData

- (NSData*) localCustomData
readwritenonatomicstrong

Custom message data. The data is saved locally and will not be sent. It will be lost after the app is reinstalled.

◆ localCustomInt

- (int) localCustomInt
readwritenonatomicassign

Custom message data. The data is saved locally and will not be sent. It will be lost after the app is reinstalled.

◆ cloudCustomData

- (NSData*) cloudCustomData
readwritenonatomicstrong

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

- (BOOL) isExcludedFromUnreadCount
readwritenonatomicassign

Set or get whether to exclude the message from the unread message count. NO (default): included in the unread message count; YES: excluded from the unread message count

Supported only in 5.3.425 and later versions and not supported by meeting groups by default

◆ isExcludedFromLastMessage

- (BOOL) isExcludedFromLastMessage
readwritenonatomicassign

Set or get whether to skip the message when determining the conversation's lastMessage. NO (default): do not skip; YES: skip Supported only in 5.4.666 and later versions.

◆ isExcludedFromContentModeration

- (BOOL) isExcludedFromContentModeration
readwritenonatomicassign

Get or set whether the current message is excluded from content moderation (cloud moderation). Works only if cloud moderation is enabled. Supported only in 7.1 and later versions.

◆ customModerationConfigurationID

- (NSString*) customModerationConfigurationID
readwritenonatomicstrong

Message custom moderation configuration ID(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.

Attention
This field needs to be set before sending messages. It determines the moderation policy when messages are sent and will not be stored in cloud or locally.

◆ hasRiskContent

- (BOOL) hasRiskContent
readnonatomicassign

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

◆ disableCloudMessagePreHook

- (BOOL) disableCloudMessagePreHook
readwritenonatomicassign

Whether to disable the cloud message hook before sending(supported only in imsdk 8.1 and later versions)

◆ disableCloudMessagePostHook

- (BOOL) disableCloudMessagePostHook
readwritenonatomicassign

Whether to disable the cloud message hook after sending(supported only in imsdk 8.1 and later versions)

◆ offlinePushInfo

- (V2TIMOfflinePushInfo*) offlinePushInfo
readnonatomicstrong

Offline push information of the message.

◆ revokerInfo

- (V2TIMUserFullInfo*) revokerInfo
readnonatomicstrong

Get the recaller's info (supported only in 7.4 and later versions) Valid only for recalled messages

◆ revokeReason

- (NSString*) revokeReason
readnonatomicstrong

Get the reason for recalling the message (supported only in 7.4 and later versions) Valid only for recalled messages

◆ pinnerInfo

- (V2TIMGroupMemberFullInfo*) pinnerInfo
readnonatomicstrong

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.