downloadAttachment method Null safety
- EMMessage message
Downloads the attachment files from the server.
You can call the method again if the attachment download fails.
Param message
The message with the attachment that is to be downloaded.
Throws A description of the exception. See {@link EMError}.
Implementation
Future<void> downloadAttachment(EMMessage message) async {
Map result = await EMMethodChannel.ChatManager.invokeMethod(
ChatMethodKeys.downloadAttachment, {"message": message.toJson()});
try {
EMError.hasErrorFromResult(result);
} on EMError catch (e) {
throw e;
}
}