getChatRoomMessages method

Future<int> getChatRoomMessages(
  1. String targetId,
  2. int timestamp,
  3. RCIMIWTimeOrder order,
  4. int count, {
  5. IRCIMIWGetChatRoomMessagesCallback? callback,
})

ZH

获取聊天室历史消息记录。 注:必须先开通聊天室消息云存储功能。

  • targetId 聊天室会话 ID
  • timestamp 起始的消息发送时间戳
  • order 拉取顺序 0:倒序,1:正序
  • count 要获取的消息数量,0 < count ≤ 50。
  • callback 事件回调。
  • 返回值 当次接口操作的状态码。0 代表调用成功 具体结果需要实现接口回调,非 0 代表当前接口调用操作失败,不会触发接口回调,详细错误参考错误码

EN Retrieve chatroom historical messages. Note: The chatroom message cloud storage feature must be enabled first.

  • targetId The chatroom conversation ID
  • timestamp The starting message timestamp
  • order The order of retrieval: 0 for descending, 1 for ascending
  • count The number of messages to retrieve, where 0 < count ≤ 50
  • callback The event callback. The SDK supports callback-style responses starting from version 5.3.1. Other callback methods for this interface are deprecated as of version 5.4.0 and are expected to be removed in version 6.x. If the callback parameter is provided, only the callback will be triggered. call, and the specific result requires implementing the interface callback. Non-zero values indicate that the current operation failed, and no interface callback will be triggered. Refer to the error codes for detailed error information. @listener onChatRoomMessagesLoaded

Implementation

Future<int> getChatRoomMessages(
  String targetId,
  int timestamp,
  RCIMIWTimeOrder order,
  int count, {
  IRCIMIWGetChatRoomMessagesCallback? callback,
}) async {
  return RCIMWrapperPlatform.instance.getChatRoomMessages(targetId, timestamp, order, count, callback: callback);
}