getMessageById method

Future getMessageById ({@required dynamic type, @required String messageId })

Implementation

Future<dynamic> getMessageById({
  @required dynamic type, /// (JMSingle | JMGroup | JMChatRoom)
  @required String messageId,
}) async {
  Map param = type.toJson();

  param..addAll({
      'messageId': messageId,
    });

  Map msgMap = await _channel.invokeMethod('getMessageById',
    param..removeWhere((key,value) => value == null));

  return JMNormalMessage.generateMessageFromJson(msgMap);
}