sendAudioMessage method

  1. @override
Future<String> sendAudioMessage(
  1. String jid,
  2. String filePath,
  3. bool isRecorded,
  4. String duration,
  5. String replyMessageId, {
  6. String? audioFileUrl,
  7. String? topicId,
})
override

This method is used to send the audio message.

Implementation

@override
Future<String> sendAudioMessage(String jid, String filePath, bool isRecorded,
    String duration, String replyMessageId,
    {String? audioFileUrl, String? topicId}) async {
  //sendAudio
  String? audioResponse;
  try {
    audioResponse =
        await mirrorFlyMethodChannel.invokeMethod('sendAudioMessage', {
      "filePath": filePath,
      "jid": jid,
      "isRecorded": isRecorded,
      "duration": duration,
      "replyMessageId": replyMessageId,
      "audiofileUrl": audioFileUrl,
      "topicId": topicId
    });
    return convertChatMessageJsonFromString(audioResponse);
  } on PlatformException catch (e) {
    LogMessage.d("Platform Exception =", " $e");
    rethrow;
  } on Exception catch (error) {
    LogMessage.d("Exception ", " $error");
    rethrow;
  }
}