sendMessage

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

Sends a message based on the conversation type.

The message status and message body are returned through the methods in .Note: The message sending rate is limited to 5 messages per second.

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.

content

The message content, such as TextMessage, ImageMessage.

pushContent

The field displayed in the notification bar when a remote push notification is sent. For custom messages, this field must be filled; otherwise, the remote push notification will not be received. For default message types in the SDK, such as RC:TxtMsg, RC:VcMsg, RC:ImgMsg, this field is optional 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 .


public abstract void sendMessage(Message message, String pushContent, String pushData, IRongCallback.ISendMessageCallback callback)

Sends a message.

The status and body of the sent message are returned through the methods in .Note: The message sending rate is limited to 5 messages per second.

Parameters

message

The message body to be sent.

pushContent

This field is displayed in the notification bar when a remote push notification is sent. If sending a custom message, this field must be filled; otherwise, the remote push notification will not be received. For 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 the remote push notification. If this field is set, users can retrieve it via getPushData when they receive the remote push notification.

callback

The callback for sending the message, refer to .


public abstract void sendMessage(Message message, String pushContent, String pushData, SendMessageOption option, IRongCallback.ISendMessageCallback callback)

Sends a message.

The status and body of the sent message are returned through the methods in .Note: The message sending rate is limited to 5 messages per second.

Parameters

message

The message body to be sent.

pushContent

When sending a remote push notification, this field will be displayed in the notification bar. For custom messages, this field must be filled; otherwise, the remote push notification will not be received. For 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 remote push notification.

option

Additional options for sending messages. Currently, only isVoIPPush is supported. If the recipient's device is iOS, setting isVoIPPush to True will send the push notification via the VoIP channel.

callback

The callback for sending the message, refer to .