appendMessage method
- ChatMessage 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 ChatError.
Implementation
Future<void> appendMessage(ChatMessage message) async {
Map req = this._toJson();
req['msg'] = message.toJson();
Map result = await _emConversationChannel.invokeMethod(
ChatMethodKeys.appendMessage, req);
try {
ChatError.hasErrorFromResult(result);
} on ChatError catch (e) {
throw e;
}
}