Skip to main content

消息对象 Message 是 SDK 封装通用消息对象,Message 更像是一个父类, Message.content 是具体的子类,例如:文本消息图片消息

属性名类型说明版本
conversationConversation消息所属会话1.0.0
contentTypeString消息类型(文本消息、图片消息等)1.0.0
contentMessageContent消息内容,内容与 messageType 属性相关,例如:name 为 jg:text 时,content 是 文本消息1.0.0
messageIdString消息 Id,区分每条的标识,全局唯一1.0.0
clientMsgNolong本端消息唯一编号(对应本地数据库唯一 id)1.0.0
directionMessageDirection消息方向,用于标识“接收的消息 or 发送的消息”1.0.0
messageStateMessageState消息状态,用于标识“发送中 or 发送成功 or 发送失败”1.0.0
hasReadboolean消息是否已读1.0.0
timestamplong消息的发送时间,格式为时间戳精确到毫秒(服务端时间)1.0.0
senderUserIdString消息发送者的 userId1.0.0
referredMessageMessage引用消息1.0.0
mentionInfoMessageMentionInfo@ 信息1.0.0
localAttributeString消息本地属性(仅对本端生效,不会同步到服务端)1.0.0
groupMessageReadInfoGroupMessageReadInfo群消息阅读信息(只对群消息生效)1.0.0
isEditboolean是否被编辑1.0.0
isDeletedboolean是否已删除1.0.0
destroyTimelong消息销毁时间戳(服务器时间,单位毫秒)。默认值为 0,表示不自动销毁。1.0.0
lifeTimeAfterReadlong消息已读后的生存周期,单位毫秒。默认值为 0,表示读后不自动销毁。1.0.0