sendDirectionalMessage

public abstract void sendDirectionalMessage(ConversationType type, String targetId, MessageContent content, Array<String> userIds, String pushContent, String pushData, 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 IRongCoreCallback.ISendMessageCallback. This method can only send non-multimedia messages. For multimedia messages such as , FileMessage, or any other messages inherited from , use sendDirectionalMediaMessage. If you are using IMLib, you can use this method to send targeted messages.

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

Since

5.0.0

Parameters

type

The conversation type.

targetId

The conversation ID, which could be a group ID or ultra group ID.

content

The message content, such as TextMessage, ImageMessage.

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. For 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 the remote push notification. 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 conversation who will receive this message.

callback

The callback for sending the message, refer to .


public abstract void sendDirectionalMessage(Message message, Array<String> userIds, String pushContent, String pushData, 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 body are returned through the methods in IRongCoreCallback.ISendMessageCallback. This method can only send non-multimedia messages. For multimedia messages such as , FileMessage, or other messages inheriting from , use sendDirectionalMediaMessage. If you are using IMLib, you can use this method to send targeted messages.

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; 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 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 through getPushData when they receive the remote push notification.

userIds

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

callback

The callback for sending the message, refer to .


public abstract void sendDirectionalMessage(ConversationType type, String targetId, MessageContent content, 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 body are returned through the methods in IRongCoreCallback.ISendMessageCallback. This method can only send non-multimedia messages. For multimedia messages such as , FileMessage, or other messages inherited from , use sendDirectionalMediaMessage. If you are using IMLib, you can use this method to send targeted messages.

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

Since

5.1.2

Parameters

type

The conversation type.

targetId

The conversation ID, which could be a group ID or ultra group ID.

content

The message content, such as TextMessage, ImageMessage.

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 the remote push notification. If this field is set, users can retrieve it via getPushData when receiving the 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 device is iOS, setting isVoIPPush to True will push the notification through 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 in 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 IRongCoreCallback.ISendMessageCallback. This method can only send non-multimedia messages. For multimedia messages such as , FileMessage, or other messages that inherit from , you must call sendDirectionalMediaMessage. If you are using IMLib, you can use this method to send targeted messages;

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

This field will be displayed in the notification bar when a remote push notification is sent. 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 through getPushData when they receive a 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 device is iOS, setting isVoIPPush to True will send the push notification through the VoIP channel.

callback

The callback for sending the message, refer to .