insertOutgoingMessage

public abstract void insertOutgoingMessage(ConversationType type, String targetId, SentStatus sentStatus, MessageContent content, RongIMClient.ResultCallback<Message> resultCallback)

Inserts a message into the local conversation.

This message is only inserted into the local conversation and will not be sent to the server or the other party. The inserted message must be a persisted message, i.e., ISPERSISTED, otherwise, the callback PARAMETER_ERROR will be triggered.

Parameters

type

The type of conversation.

targetId

The ID of the conversation. For example, in a private conversation, it is the ID of the other party; in a group conversation, it is the group ID; in a discussion group conversation, it is the ID of the discussion group.

sentStatus

The sending status Message.SentStatus.

content

The message content. For example, TextMessage, ImageMessage, etc.

resultCallback

The callback to get the message sending entity.


public abstract void insertOutgoingMessage(ConversationType type, String targetId, SentStatus sentStatus, MessageContent content, long sentTime, RongIMClient.ResultCallback<Message> resultCallback)

Inserts a message into the local conversation with the direction set to sent.

This message is only inserted into the local conversation and will not be actually sent to the server or the recipient. The inserted message must be a persisted message, i.e., ISPERSISTED, otherwise the callback PARAMETER_ERROR will be triggered.

Parameters

type

The type of the conversation.

targetId

The ID of the conversation. For example, in a one-to-one chat, it is the ID of the other party; in a group chat, it is the group ID; in a discussion group, it is the ID of the discussion group.

sentStatus

The sending status Message.SentStatus.

content

The content of the message, such as TextMessage, ImageMessage, etc.

sentTime

The sending time of the message getSentTime.

resultCallback

The callback to obtain the message sending entity.