appendMessage method Null safety
- EMMessage message
Inserts a message to the end of a conversation in the local database.
Make sure you set the conversation ID as that of the conversation where you want to insert the message.
Param message
The message instance.
Throws A description of the exception. See {@link EMError}.
Implementation
Future<void> appendMessage(EMMessage message) async {
Map req = this._toJson();
req['msg'] = message.toJson();
Map result = await _emConversationChannel.invokeMethod(
ChatMethodKeys.appendMessage, req);
try {
EMError.hasErrorFromResult(result);
} on EMError catch (e) {
throw e;
}
}