Link Search Menu Expand Document

Incoming message

Table of contents


Overview

The chat partner(chatbot, agent) side messages.
Displays textual and HTML formatted messages. The incoming message component also supports the display of avatar image and timestamp.

Chatbot messages may be constructed by multiple UI components, depends on the message content. The incoming message component contains the textual content of the message, persistent options, readmore. Other message properties such channels quick options and feedback, are displyed by separate components.


How to customize

The incoming message component supports many customizatins.

To see all supported configuration open IncomingMessageConfiguration.

The default configuration can be changed via

  • ChatController.viewConfiguration.incomingBotConfig
  • ChatController.viewConfiguration.incomingLiveConfig
lazy var chatConfig = { () -> Bold360AI.ChatConfiguration in
        var config = Bold360AI.ChatConfiguration()
        return config
    }()

    func updateBotIncoming() {
        self.chatConfig.incomingBotConfig.backgroundColor = UIColor.yellow
        self.chatConfig.incomingBotConfig.textColor = UIColor.red
    }

    func updateLiveIncoming() {
        self.chatConfig.incomingLiveConfig.backgroundColor = UIColor.green
        self.chatConfig.incomingLiveConfig.textColor = UIColor.blue
    }

Before & After

Before After
1 1

Readmore component on long chatbot messages

Chatbot messages content display has a length limit, called threshold. Messages that are longer than the configured threshold length, will be trimmed.
A readmore component will appear on the bottom of a trimmed message, leading to a full message view.

The readmore component supports configuration under incomingBotConfig.

    func updateBotIncoming() {
        self.chatConfig.incomingBotConfig.backgroundColor = UIColor.yellow
        self.chatConfig.incomingBotConfig.textColor = UIColor.red
    }

Before & After

  Before After
Standard Read More 1 1
Styled Read More 1 1

Customizing chatbot message length display

By default the threshold is configured to limit the text length to 320 characters.
The threshold can be configured to different value.

Works only for incomingBotConfig.

    func updateBotIncoming() {
        self.chatConfig.incomingBotConfig.maxLength = 100
    }