getChatRoomMessages method
Future<int>
getChatRoomMessages(
- String targetId,
- int timestamp,
- RCIMIWTimeOrder order,
- int count, {
- IRCIMIWGetChatRoomMessagesCallback? callback,
ZH
获取聊天室历史消息记录。 注:必须先开通聊天室消息云存储功能。
targetId聊天室会话 IDtimestamp起始的消息发送时间戳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.
targetIdThe chatroom conversation IDtimestampThe starting message timestamporderThe order of retrieval: 0 for descending, 1 for ascendingcountThe number of messages to retrieve, where 0 < count ≤ 50callbackThe 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);
}