Skip to main content

The Message object is the common message object provided by the SDK. It acts like a base class; Message.content is a concrete subtype, such as a text message or image message.

PropertyTypeDescriptionVersion
conversationConversationConversation that contains the message.1.0.0
contentTypeStringMessage type, such as text or image.1.0.0
contentMessageContentMessage content. It depends on contentType; for example, when contentType is jg:text, content is a text message.1.0.0
messageIdStringGlobally unique message identifier.1.0.0
clientMsgNolongLocal unique message number (the unique ID in the local database).1.0.0
directionMessageDirectionMessage direction, indicating "received message or sent message"1.0.0
stateMessageStateMessage state, indicating "sending or sent successfully or failed to send"1.0.0
hasReadbooleanWhether the message has been read.1.0.0
timestamplongMessage send time, as a server timestamp in milliseconds.1.0.0
senderUserIdStringSender userId.1.0.0
referredMessageMessageReferenced message.1.0.0
mentionInfoMessageMentionInfoMention information.1.0.0
localAttributeStringLocal message attributes. They apply only on this client and are not synchronized to the server.1.0.0
groupMessageReadInfoGroupMessageReadInfoGroup-message read information. Applies only to group messages.1.0.0
isEditbooleanWhether the message was edited.1.0.0
isDeletedbooleanWhether the message was deleted.1.0.0
destroyTimelongMessage destruction timestamp in server milliseconds. The default value 0 means no automatic destruction.1.0.0
lifeTimeAfterReadlongMessage lifetime after reading, in milliseconds. The default value 0 means no automatic destruction after reading.1.0.0
senderDisplayNameStringSender display name, shown according to the default display rules1.8.39
friendAliasStringSender friend alias.1.8.39
groupMemberAliasStringSender group-member alias.1.8.39
senderNameStringSender actual name.1.8.39
senderPortraitStringSender avatar URL.1.8.39