insertIncomingMessage

public abstract void insertIncomingMessage(ConversationType type, String targetId, String senderUserId, ReceivedStatus receivedStatus, MessageContent content, RongIMClient.ResultCallback<Message> resultCallback)

Inserts a message into the local conversation with the direction set as received.

This message is only inserted into the local conversation and will not be 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 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.

senderUserId

The ID of the sender.

receivedStatus

The received status Message.ReceivedStatus.

content

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

resultCallback

The callback to obtain the message sending entity.


public abstract void insertIncomingMessage(ConversationType type, String targetId, String senderUserId, ReceivedStatus receivedStatus, MessageContent content, long sentTime, RongIMClient.ResultCallback<Message> resultCallback)

Inserts a message into the local conversation with the direction set as received.

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 the conversation.

targetId

The ID of the conversation. For private conversations, this is the ID of the other party; for group conversations, this is the group ID; for discussion group conversations, this is the discussion group ID.

senderUserId

The ID of the sender.

receivedStatus

The received status Message.ReceivedStatus.

content

The content of the message. Examples include TextMessage, , etc.

sentTime

The sent time of the message getSentTime.

resultCallback

Callback to obtain the message entity.