deleteMessagesWithTs method

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

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.

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;
  }
}