human: 如何处理七牛云的即时通讯BMXMessage

gpt: [即时通讯](https://developer.qiniu.com/IM) > API 文档 > [ANDROID
API](https://developer.qiniu.com/IM/api/8191/android-im-class-indexes) >
BMXMessage

#  BMXMessage

最近更新时间: 2022-07-22 22:46:04

class im.floo.floolib.BMXMessage

消息

Index

方法

  * getCPtr
  * finalize
  * delete
  * msgId
  * clientMsgId
  * fromId
  * toId
  * type
  * conversationId
  * deliveryStatus
  * setDeliveryStatus
  * serverTimestamp
  * setServerTimestamp
  * clientTimestamp
  * setClientTimestamp
  * isPlayed
  * setIsPlayed
  * isPlayAcked
  * setIsPlayAcked
  * isReceiveMsg
  * setIsReceiveMsg
  * isRead
  * setIsRead
  * isReadAcked
  * setIsReadAcked
  * isDeliveryAcked
  * setIsDeliveryAcked
  * content
  * setContent
  * contentType
  * attachment
  * config
  * setConfig
  * extension
  * setExtension
  * deliveryQos
  * setDeliveryQos
  * senderName
  * setSenderName
  * groupAckCount
  * groupAckUnreadCount
  * groupAckReadAll
  * groupPlayAckCount
  * setGroupPlayAckCount
  * groupPlayAckUnreadCount
  * setGroupPlayAckUnreadCount
  * groupPlayAckReadAll
  * setPriority
  * priority
  * setPushMessageMode
  * isPushMessage
  * createMessage
  * createMessage
  * createCommandMessage
  * createMessage
  * createMessage
  * createCommandMessage
  * createForwardMessage

方法

getCPtr

  * protected static long getCPtr(BMXMessage obj);
  * Returns long

finalize

  * protected void finalize();
  * Returns void

delete

  * public synchronized void delete();
  * Returns void

msgId

  * public long msgId();
  * 消息唯一ID

Returns long

clientMsgId

  * public long clientMsgId();
  * 消息客户端ID,仅在消息发送端存在

Returns long

fromId

  * public long fromId();
  * 消息发送方ID

Returns long

toId

  * public long toId();
  * 消息接收方ID

Returns long

type

  * public BMXMessage.MessageType type();
  * 消息类型

Returns MessageType

conversationId

  * public long conversationId();
  * 消息所属会话ID

Returns long

deliveryStatus

  * public BMXMessage.DeliveryStatus deliveryStatus();
  * 消息投递状态

Returns DeliveryStatus

setDeliveryStatus

  * public void setDeliveryStatus(BMXMessage.DeliveryStatus arg0);
  * 设置消息投递状态

Returns void

serverTimestamp

  * public long serverTimestamp();
  * 消息时间戳（服务端收到时的时间）

Returns long

setServerTimestamp

  * public void setServerTimestamp(long arg0);
  * 设置时间戳（服务端收到时的时间）

Returns void

clientTimestamp

  * public long clientTimestamp();
  * 本地时间戳（消息创建或者收到时的本地时间）

Returns long

setClientTimestamp

  * public void setClientTimestamp(long arg0);
  * 设置消息本地时间戳

Returns void

isPlayed

  * public boolean isPlayed();
  * 语音或者视频消息是否播放过，仅对收到的音视频消息有效

Returns boolean

setIsPlayed

  * public void setIsPlayed(boolean arg0);
  * Returns void

isPlayAcked

  * public boolean isPlayAcked();
  * 语音或者视频消息是否收到播放回执，仅对收到的音视频消息有效

Returns boolean

setIsPlayAcked

  * public void setIsPlayAcked(boolean arg0);
  * Returns void

isReceiveMsg

  * public boolean isReceiveMsg();
  * 是否接收的消息

Returns boolean

setIsReceiveMsg

  * public void setIsReceiveMsg(boolean arg0);
  * Returns void

isRead

  * public boolean isRead();
  * 消息是否已读标志

Returns boolean

setIsRead

  * public void setIsRead(boolean arg0);
  * Returns void

isReadAcked

  * public boolean isReadAcked();
  * 对于发送方表示是否收到了已读回执，对于接收方表示是否发送了已读回执

Returns boolean

setIsReadAcked

  * public void setIsReadAcked(boolean arg0);
  * Returns void

isDeliveryAcked

  * public boolean isDeliveryAcked();
  * 对于发送方表示消息是否已投递到对方，对于接收方表示是否发送了消息已到达回执

Returns boolean

setIsDeliveryAcked

  * public void setIsDeliveryAcked(boolean arg0);
  * Returns void

content

  * public String content();
  * 消息文本内容

Returns String

setContent

  * public void setContent(String content);
  * 消息文本内容

Parameters

    * content: String 

消息文本内容

Returns void

contentType

  * public BMXMessage.ContentType contentType();
  * 消息内容类型，如果带附件就表示附件类型，不带附件就是文本类型

Returns ContentType

attachment

  * public BMXMessageAttachment attachment();
  * 消息附件，BMXMessage拥有附件的所有权，负责释放

Returns
[BMXMessageAttachment](https://developer.qiniu.com/IM/api/8244/bmxmessageattachment)

config

  * public BMXMessageConfig config();
  * 消息的配置信息

Returns
[BMXMessageConfig](https://developer.qiniu.com/IM/api/8248/bmxmessageconfig)

setConfig

  * public void setConfig(BMXMessageConfig arg0);
  * 设置消息配置信息

Returns void

extension

  * public String extension();
  * 消息扩展信息

Returns String

setExtension

  * public void setExtension(String arg0);
  * 设置消息扩展信息

Returns void

deliveryQos

  * public BMXMessage.DeliveryQos deliveryQos();
  * 消息投递QOS

Returns DeliveryQos

setDeliveryQos

  * public void setDeliveryQos(BMXMessage.DeliveryQos qos);
  * 设置消息投递QOS

Parameters

    * qos: DeliveryQos 

消息投递QOS

Returns void

senderName

  * public String senderName();
  * 消息发送者的显示名称

Returns String

setSenderName

  * public void setSenderName(String senderName);
  * 设置消息的发送者显示名称

Parameters

    * senderName: String 

消息文本内容

Returns void

groupAckCount

  * public int groupAckCount();
  * 群消息已读AckCount数目

Returns int

groupAckUnreadCount

  * public int groupAckUnreadCount();
  * 群消息未读AckCount数目

Returns int

groupAckReadAll

  * public boolean groupAckReadAll();
  * 群消息是否全部已读

Returns boolean

groupPlayAckCount

  * public int groupPlayAckCount();
  * 获取群消息已播放计数

Returns int

setGroupPlayAckCount

  * public void setGroupPlayAckCount(int count);
  * Returns void

groupPlayAckUnreadCount

  * public int groupPlayAckUnreadCount();
  * 获取群消息已播放回执未读计数

Returns int

setGroupPlayAckUnreadCount

  * public void setGroupPlayAckUnreadCount(int count);
  * Returns void

groupPlayAckReadAll

  * public boolean groupPlayAckReadAll();
  * 设置所有群消息已播回执为已读

Returns boolean

setPriority

  * public void setPriority(int priority);
  * 设置消息的扩散优先级，默认为0。0表示扩散，数字越小扩散的越多。 取值范围0-10。普通人在聊天室发送的消息级别默认为5，可以丢弃。管理员默认为0不会丢弃。其它值可以根据业务自行设置。

Parameters

    * priority: int 

优先级

Returns void

priority

  * public int priority();
  * 消息的扩散优先级

Returns int

setPushMessageMode

  * public void setPushMessageMode(boolean arg0);
  * 设置是否推送消息

Returns void

isPushMessage

  * public boolean isPushMessage();
  * 是否是推送消息

Returns boolean

createMessage

  * public static BMXMessage createMessage(long from, long to, BMXMessage.MessageType type, long conversationId, String content);
  * 创建发送文本消息

Parameters

    * from: long 

消息发送者

    * to: long 

消息接收者

    * type: MessageType 

消息类型

    * conversationId: long 

会话id

    * content: String 

消息内容

Returns [BMXMessage](https://developer.qiniu.com/IM/api/8239/bmxmessage)

createMessage

  * public static BMXMessage createMessage(long from, long to, BMXMessage.MessageType type, long conversationId, BMXMessageAttachment attachment);
  * 创建发送附件消息

Parameters

    * from: long 

消息发送者

    * to: long 

消息接收者

    * type: MessageType 

消息类型

    * conversationId: long 

会话id

    * attachment: [BMXMessageAttachment](https://developer.qiniu.com/IM/api/8244/bmxmessageattachment)

附件

Returns [BMXMessage](https://developer.qiniu.com/IM/api/8239/bmxmessage)

createCommandMessage

  * public static BMXMessage createCommandMessage(long from, long to, BMXMessage.MessageType type, long conversationId, String content);
  * 创建发送命令消息(命令消息通过content字段或者extension字段存放命令信息)

Parameters

    * from: long 

消息发送者

    * to: long 

消息接收者

    * type: MessageType 

消息类型

    * conversationId: long 

会话id

    * content: String 

消息内容

Returns [BMXMessage](https://developer.qiniu.com/IM/api/8239/bmxmessage)

createMessage

  * public static BMXMessage createMessage(long msgId, long from, long to, BMXMessage.MessageType type, long conversationId, String content, long serverTimestamp);
  * 创建收到的消息

Parameters

    * msgId: long 

消息id

    * from: long 

消息发送者

    * to: long 

消息接收者

    * type: MessageType 

消息类型

    * conversationId: long 

会话id

    * content: String 

消息内容

    * serverTimestamp: long 

服务器时间戳

Returns [BMXMessage](https://developer.qiniu.com/IM/api/8239/bmxmessage)

createMessage

  * public static BMXMessage createMessage(long msgId, long from, long to, BMXMessage.MessageType type, long conversationId, BMXMessageAttachment attachment, long serverTimestamp);
  * 创建收到的消息

Parameters

    * msgId: long 

消息id

    * from: long 

消息发送者

    * to: long 

消息接收者

    * type: MessageType 

消息类型

    * conversationId: long 

会话id

    * attachment: [BMXMessageAttachment](https://developer.qiniu.com/IM/api/8244/bmxmessageattachment)

附件

    * serverTimestamp: long 

服务器时间戳

Returns [BMXMessage](https://developer.qiniu.com/IM/api/8239/bmxmessage)

createCommandMessage

  * public static BMXMessage createCommandMessage(long msgId, long from, long to, BMXMessage.MessageType type, long conversationId, String content, long serverTimestamp);
  * 创建收到的命令消息(命令消息通过content字段或者extension字段存放命令信息)

Parameters

    * msgId: long 

消息id

    * from: long 

消息发送者

    * to: long 

消息接收者

    * type: MessageType 

消息类型

    * conversationId: long 

会话id

    * content: String 

消息内容

    * serverTimestamp: long 

服务器时间戳

Returns [BMXMessage](https://developer.qiniu.com/IM/api/8239/bmxmessage)

createForwardMessage

  * public static BMXMessage createForwardMessage(BMXMessage msg, long from, long to, BMXMessage.MessageType type, long conversationId);
  * 创建转发消息

Parameters

    * msg: [BMXMessage](https://developer.qiniu.com/IM/api/8239/bmxmessage)

要转发的消息

    * from: long 

消息发送者

    * to: long 

消息接收者

    * type: MessageType 

消息类型

    * conversationId: long 

会话id

Returns [BMXMessage](https://developer.qiniu.com/IM/api/8239/bmxmessage)

以上内容是否对您有帮助？