sendImageMessage method

  1. @override
Future<String> sendImageMessage(
  1. String jid,
  2. String filePath,
  3. String? caption,
  4. String? replyMessageID, {
  5. String? imageFileUrl,
  6. String? topicId,
})
override

This method is used to send the image message.

Implementation

@override
Future<String> sendImageMessage(
    String jid, String filePath, String? caption, String? replyMessageID,
    {String? imageFileUrl, String? topicId}) async {
  String? messageResp;
  try {
    messageResp =
        await mirrorFlyMethodChannel.invokeMethod('send_image_message', {
      "jid": jid,
      "filePath": filePath,
      "caption": caption?.trim(),
      "replyMessageId": replyMessageID,
      "imageFileUrl": imageFileUrl,
      "topicId": topicId
    });
    return convertChatMessageJsonFromString(messageResp);
  } on PlatformException catch (e) {
    LogMessage.d("Image Message Exception =", " $e");
    rethrow;
  } on Exception catch (error) {
    LogMessage.d("Image Message Exception ", " $error");
    rethrow;
  }
}