sendDocumentMessage method

  1. @override
Future<String> sendDocumentMessage(
  1. String jid,
  2. String documentPath,
  3. String replyMessageId, {
  4. String? fileUrl,
  5. String? topicId,
})
override

This method is used to send the document message.

Implementation

@override
Future<String> sendDocumentMessage(
    String jid, String documentPath, String replyMessageId,
    {String? fileUrl, String? topicId}) async {
  String? documentResponse;
  try {
    documentResponse =
        await mirrorFlyMethodChannel.invokeMethod('sendDocumentMessage', {
      "file": documentPath,
      "jid": jid,
      "replyMessageId": replyMessageId,
      "file_url": fileUrl,
      "topicId": topicId
    });
    return convertChatMessageJsonFromString(documentResponse);
  } on PlatformException catch (e) {
    LogMessage.d("Platform Exception =", " $e");
    rethrow;
  } on Exception catch (error) {
    LogMessage.d("Exception ", " $error");
    rethrow;
  }
}