Class SendMessageParams

  • All Implemented Interfaces:

    
    public final class SendMessageParams
    
                        

    Send message parameters.

    Required parameters for sending a normal (non-media) message.

    Usage example:

    val params = SendMessageParams(TextMessage("Hello")).apply {
        pushConfig = PushConfig().apply {
            pushContent = "You received a message"
            pushData = "{\"key\":\"value\"}"
        }
    }
    channel.sendMessage(params) { msg, error ->
        // ...
    }
    • Constructor Detail

    • Method Detail

      • getPushConfig

         final PushConfig getPushConfig()

        Push configuration.

        Used to customize the remote push title, content, additional data, etc. If sending a custom message, it is recommended to set PushConfig.pushContent; otherwise the recipient may not receive remote push notifications. SDK built-in message types (e.g. TextMessage) do not need this, as defaults are already specified.

      • setPushConfig

         final Unit setPushConfig(PushConfig pushConfig)

        Push configuration.

        Used to customize the remote push title, content, additional data, etc. If sending a custom message, it is recommended to set PushConfig.pushContent; otherwise the recipient may not receive remote push notifications. SDK built-in message types (e.g. TextMessage) do not need this, as defaults are already specified.

      • getDirectedUserIds

         final Array<String> getDirectedUserIds()

        Target user ID list for directed messages.

        When set, this message is sent as a directed message. Only the specified users can receive it; it is not visible to other members in the channel.

        null for normal sending, non-empty for directed sending.

      • setDirectedUserIds

         final Unit setDirectedUserIds(Array<String> directedUserIds)

        Target user ID list for directed messages.

        When set, this message is sent as a directed message. Only the specified users can receive it; it is not visible to other members in the channel.

        null for normal sending, non-empty for directed sending.

      • getDisableNotification

         final Boolean getDisableNotification()

        Whether to disable push notification for this message.

        When set to true, the recipient will not receive a push notification for this message.

      • setDisableNotification

         final Unit setDisableNotification(Boolean disableNotification)

        Whether to disable push notification for this message.

        When set to true, the recipient will not receive a push notification for this message.

      • getDisableUpdateLastMessage

         final Boolean getDisableUpdateLastMessage()

        Whether to prevent this message from updating the channel's latest message.

        When set to true, this message will not update the channel's last message display.

      • setDisableUpdateLastMessage

         final Unit setDisableUpdateLastMessage(Boolean disableUpdateLastMessage)

        Whether to prevent this message from updating the channel's latest message.

        When set to true, this message will not update the channel's last message display.

      • getMetadata

         final Map<String, String> getMetadata()

        Message metadata in key-value format.

        Supports remote sync. Can be used to attach custom key-value data to the message.

      • setMetadata

         final Unit setMetadata(Map<String, String> metadata)

        Message metadata in key-value format.

        Supports remote sync. Can be used to attach custom key-value data to the message.

      • getNeedReceipt

         final Boolean getNeedReceipt()

        Whether this message requires a read receipt.

        When set to true, the sender will be able to track whether recipients have read this message.

      • setNeedReceipt

         final Unit setNeedReceipt(Boolean needReceipt)

        Whether this message requires a read receipt.

        When set to true, the sender will be able to track whether recipients have read this message.