sendAudioMessage method

  1. @override
Future sendAudioMessage(
  1. String jid,
  2. String filePath,
  3. bool isRecorded,
  4. String duration,
  5. String replyMessageId, [
  6. String? audiofileUrl,
])
override

Implementation

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