deleteMessagesWithTs method

Future<void> deleteMessagesWithTs(
  1. int startTs,
  2. int endTs
)

~english Deletes messages sent or received in a certain period from the local database.

Param startTs The starting UNIX timestamp for message deletion. The unit is millisecond.

Param endTs The end UNIX timestamp for message deletion. The unit is millisecond.

Throws A description of the exception. See ChatError.

~end

~chinese 从本地数据库中删除指定时间段内的消息。

Param startTs 删除消息的起始时间。UNIX 时间戳,单位为毫秒。

Param endTs 删除消息的结束时间。UNIX 时间戳,单位为毫秒。

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

Implementation

Future<void> deleteMessagesWithTs(int startTs, int endTs) async {
  Map req = this._toJson();
  req['startTs'] = startTs;
  req['endTs'] = endTs;
  Map result = await _emConversationChannel.invokeMethod(
      ChatMethodKeys.deleteMessagesWithTs, req);
  try {
    ChatError.hasErrorFromResult(result);
  } on ChatError catch (e) {
    throw e;
  }
}