sendTextMessage method

  1. @override
Future<String> sendTextMessage(
  1. String message,
  2. String jid,
  3. String replyMessageId, {
  4. String? topicId,
})
override

This method is used to send the text message.

Implementation

@override
Future<String> sendTextMessage(
    String message, String jid, String replyMessageId,
    {String? topicId}) async {
  String? messageResp;
  try {
    messageResp = await mirrorFlyMethodChannel.invokeMethod('send_text_msg', {
      "message": message,
      "JID": jid,
      "replyMessageId": replyMessageId,
      "topicId": topicId
    });
    return convertChatMessageJsonFromString(messageResp);
  } on PlatformException catch (e) {
    LogMessage.d("Flutter Exception =", " $e");
    rethrow;
  } on Exception catch (error) {
    LogMessage.d("Flutter Exception ", " $error");
    rethrow;
  }
}