sendMessage

public abstract void sendMessage(ConversationType type, String targetId, String channelId, MessageContent content, String pushContent, String pushData, IRongCoreCallback.ISendMessageCallback callback)

Sends a message based on the conversation type.

The message status and message body are returned through the methods in . Note: The number of messages sent per second cannot exceed 5.

Since

5.1.1

Parameters

type

The conversation type.

targetId

The conversation ID. Depending on the conversationType, it could be a user ID, discussion group ID, group ID, or chatroom ID.

channelId

The business identifier of the conversation to which the message belongs.

content

The message content, such as io.rong.message.TextMessage, .

pushContent

When sending a remote push notification, this field will be displayed in the notification bar. If sending a custom message, this field must be filled in; otherwise, the remote push notification will not be received. If sending default message types in the SDK, such as RC:TxtMsg, RC:VcMsg, RC:ImgMsg, this field is not required as it is already specified by default.

pushData

Additional information for remote push notifications. If this field is set, users can retrieve it via getPushData when they receive the push message.

callback

The callback for sending the message. Refer to .