initializeMessageList method

  1. @override
Future<bool> initializeMessageList({
  1. required String userJid,
  2. String? messageId,
  3. String? chatId,
  4. double? messageTime,
  5. bool? exclude,
  6. int limit = 25,
  7. String? topicId,
  8. MetaDataMessageList? metaDataMessageList,
  9. bool ascendingOrder = true,
})
override

This method is used to get the message list.

Implementation

@override
Future<bool> initializeMessageList(
    {required String userJid,
    String? messageId,
    String? chatId,
    double? messageTime,
    bool? exclude,
    int limit = 25,
    String? topicId,
    MetaDataMessageList? metaDataMessageList,
    bool ascendingOrder = true}) async {
  bool initializeResponse;
  try {
    initializeResponse =
        await mirrorFlyMethodChannel.invokeMethod('initializeMessageList', {
      "userJid": userJid,
      "messageId": messageId,
      "messageTime": messageTime,
      "exclude": exclude,
      "limit": limit,
      "ascendingOrder": ascendingOrder,
      "topicId": topicId,
      "metaDataMessageList": metaDataMessageList?.toMap()
    });
    LogMessage.d("initializeMessageList", "$initializeResponse");
    return initializeResponse;
  } on PlatformException catch (e) {
    LogMessage.d("Platform Exception =", " $e");
    rethrow;
  } on Exception catch (error) {
    LogMessage.d("Exception ", " $error");
    rethrow;
  }
}