sendDirectionalMessage

public abstract void sendDirectionalMessage(ConversationType type, String targetId, String channelId, MessageContent content, Array<String> userIds, String pushContent, String pushData, SendMessageOption option, IRongCoreCallback.ISendMessageCallback callback)

Send a targeted message.

This method is used to send a message to specific users in a group or ultra group. Other users will not receive this message.

The message status and message body are returned through the methods in .

This method can only send non-multimedia messages. For multimedia messages such as , io.rong.message.FileMessage, or other messages inherited from io.rong.message.MediaMessageContent, use sendDirectionalMessage

If you are using IMLib, you can use this method to send targeted messages. If you are using IMKit, please use the method of the same name in RongIM to send targeted messages; otherwise, the UI will not be updated automatically.

Starting from version 5.6.9, ultra group conversation types are supported.

Since

5.1.1

Parameters

type

The conversation type.

targetId

The conversation ID. This could be a group ID or ultra group 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 a remote push notification is sent, this field will be displayed in the notification bar. If you are sending a custom message, this field must be filled in; otherwise, the remote push notification will not be received. If you are sending default message types in the SDK, such as RC:TxtMsg, RC:VcMsg, RC:ImgMsg, this field does not need to be filled in 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 a remote push notification.

userIds

The list of users in the discussion group or group conversation who will receive this message.

option

Additional options for sending the message. 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 .


public abstract void sendDirectionalMessage(Message message, Array<String> userIds, String pushContent, String pushData, SendMessageOption option, IRongCoreCallback.ISendMessageCallback callback)

Sends a targeted message.

This method is used to send a message to specific users within a group or ultra group, while other users will not receive this message.

The message status and message body are returned through the methods in .

This method can only send non-multimedia messages. For multimedia messages such as , io.rong.message.FileMessage, or any other messages that inherit from io.rong.message.MediaMessageContent, use sendDirectionalMessage

If you are using IMLib, you can use this method to send targeted messages. If you are using IMKit, use the method with the same name in RongIM to send targeted messages; otherwise, the UI will not be automatically updated.

Starting from version 5.6.9, ultra group conversation types are supported.

Since

5.2.3

Parameters

message

The message object to be sent.

pushContent

When a remote push notification is sent, this field will be displayed in the notification bar. If you are sending a custom message, this field must be filled in; otherwise, the remote push notification will not be received. If you are sending default message types in the SDK, such as RC:TxtMsg, RC:VcMsg, RC:ImgMsg, this field does not need to be filled in 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.

userIds

The list of users in the discussion group or group who will receive this message.

option

Additional options for sending the message. Currently, only isVoIPPush is supported. If the recipient's device is iOS and isVoIPPush is set to True, the push notification will be sent via the VoIP channel.

callback

The callback for sending the message. Refer to .