deleteRemoteMessagesBefore method
- {required String conversationId,
- required EMConversationType type,
- required int timestamp}
根据时间 单向删除服务器会话中的消息和本地消息。
Param conversationId
会话 ID。
Param type
会话类型。
Param timestamp
以毫秒为单位的UNIX时间戳。时间戳小于指定时间戳的消息将被删除。
Implementation
Future<void> deleteRemoteMessagesBefore(
{required String conversationId,
required EMConversationType type,
required int timestamp}) async {
Map request = {
"convId": conversationId,
"type": type.index,
"timestamp": timestamp,
};
Map result = await ChatChannel.invokeMethod(
ChatMethodKeys.removeMessagesFromServerWithTs,
request,
);
try {
EMError.hasErrorFromResult(result);
} on EMError catch (e) {
throw e;
}
}