sendMediaFileMessage method
Future<void>
sendMediaFileMessage({
- required FileMessage messageParams,
- required dynamic callback(
- FlyResponse response
override
This method is used to send the file message.
Implementation
@override
Future<void> sendMediaFileMessage(
{required FileMessage messageParams,
required Function(FlyResponse response) callback}) async {
LogMessage.d("sendMediaFileMessage", messageParams.toMap());
//sendMediaFileMessage
String? messageResponse;
try {
messageResponse = await mirrorFlyMethodChannel.invokeMethod(
'sendMediaFileMessage', messageParams.toMap());
var res = convertChatMessageJsonFromString(messageResponse);
callback.call(FlyResponse(true, res, "message send successfully"));
} on PlatformException catch (e) {
LogMessage.d("Platform Exception =", " $e");
callback.call(FlyResponse(false, FlyConstants.empty, FlyConstants.empty,
FlyException(e.code, e.message, e.details)));
} on Exception catch (e) {
LogMessage.d("Exception ", " $e");
callback.call(FlyResponse(false, FlyConstants.empty, FlyConstants.empty,
FlyException(FlyErrorCode.unHandle, FlyErrorMessage.unHandle, e)));
}
}