importMessages method

Future<void> importMessages(
  1. List<EMMessage> messages
)

~english Imports messages to the local database.

Before importing, ensure that the sender or recipient of the message is the current user.

It is recommended that you import at most 1,000 messages each time.

Param messages The message list.

Throws A description of the exception. See EMError. ~end

~chinese 将消息导入本地数据库。

只能将当前用户发送或接收的消息导入本地数据库。 已经对函数做过速度优化,推荐一次导入 1,000 条以内的数据。

Param messages 需要导入数据库的消息。

Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 EMError。 ~end

Implementation

Future<void> importMessages(List<EMMessage> messages) async {
  return Client.instance.chatManager.importMessages(messages);
}