Appearance and Behavior Customization
The chat design and behavior are set by the THRAttributes
fields.
info
Starting with 3.8.4 , a part of the values of THRAttributes
are located in ThreadsLocalizable.
Display Settings
History
historyLoadingCount
- Number of messages that are displayed from the history. Default:50
.
Navigation Behavior
canShowSpecialistInfo
- Parameter that controls whether to show the agent info screen (it opens when tapping the agent's avatar).
Loading Spinner + Screen
launchActivityViewColor
- (Spinner) Color of the animation that shows the loading processlaunchViewInnerBoxBackgroundColor
- (Spinner) Color of the rectangle in the middle of the screenlaunchViewInnerBoxCornerRadius
- (Spinner) Radius of rounding the corners of the rectangle in the middle of the screenlaunchViewInnerBoxSize
- (Spinner) Size of the rectangle in the middle of the screenlaunchViewTextColor
- (Spinner) Color of the text below the animationlaunchViewTextFont
- (Spinner) Font of the text below the animationlaunchViewBackgroundColor
- (Spinner) Loading screen colorloadingChatErrorImage
- (Loading Screen) (UIImage) Picture on screenloadingChatTitleFont
- (Loading Screen) Font of the textloadingChatTitleColor
- (Loading Screen) Color of the textloadingChatSubtitleFont
- (Loading Screen) Font of the subtitleloadingChatSubtitleColor
- (Loading Screen) Color of the subtitleloadingChatRepeatButtonTitleFont
- (Loading Screen) Font of the buttonloadingChatRepeatButtonTitleColor
- (Loading Screen) Color of the button's titleloadingChatRepeatButtonBackgroundColor
- (Loading Screen) Color of the button's background
Appearance of navigationBar
statusBarStyle
- Style of the status bar. It is only applied if the chat is integrated for the whole screendefault: UIStatusBarStyleLightContent
navigationBarVisible
- Attribute that indicates whether the chat header is displayed (by default, it is hidden)attributes.showCloseButton
- Attribute that indicates when the chat close button is hiddencloseButtonColor
- (UIColor) Color of the chat close button (template rendering)closeButtonImage
- (UIImage) Icon of the chat close button (template rendering)navigationBarTitleFont
- Font of the main text in the chat headernavigationBarTitleColor
- Color of the main text in the chat headernavigationBarBackButtonColor
- Color of the back button in the chat headernavigationBarSubtitleFont
- Sub-heading font of the chat headernavigationBarSubtitleColor
- Sub-heading color of the chat headerchatStateNotConnectedTitle
(deprecated starting with 3.8.4) - Chat header when there's no connection; by default, it is "Contact center". Starting from 3.8.4, it has been moved toThreadsLocalizable
. The new key isstate_not_connected
.chatStateReadyTitle
(deprecated starting with 3.8.4) - Header of the chat that is ready for work; by default, it is "Contact center". Starting from 3.8.4, it has been moved to ThreadsLocalizable. The new key usstate_ready
.navigationBarSubtitleShowOrgUnit
- Indicates whether to display the agent's department. It is disabled by default.navigationBarCustomizeTitle
- Indicates whether to display a dynamic heading in the chat header. It is enabled by default.navigationBarTitle
- Static heading in the chat headernavigationBarLarge
- Enhanced heading in the chat header, alignment to the left, the chat close button is disabled.navigationBarShadow
- Navigation bar shadow (disabled by default)navigationBarShadowSettings
- (THRSettingsShadow) A set of settings for the navigation bar grouped into a structure
let shadowSettings = THRSettingsShadow(opacity: 1.0,
radius: 3.0,
offset: CGSize(width: 3.0, height: 3.0),
color: .black)
Threads.threads().attributes.navigationBarShadowSettings = shadowSettings
Welcome Screen
info
It is displayed while there are no messages in the chat.
helloTitle
(deprecated starting with 3.8.4) - Heading, short text in a large font. Starting from 3.8.4, it has been moved toThreadsLocalizable
. The new key isplaceholder_header
.helloDescription
(deprecated starting with 3.8.4) - Heading, longer text in a large font. Starting from 3.8.4, it has been moved toThreadsLocalizable
. The new key isplaceholder_content
.backgroundColor
- Background color of the chatplaceholderImage
- Image on the empty screenplaceholderTitleColor
- Main text color on the empty screenplaceholderSubtitleColor
- Description color on the empty screenplaceholderTitleFont
- Font of the main color on the empty screenplaceholderSubtitleFont
- Font of the description on the empty screen
Appearance of Message Input Field
showAttachButton
- Indicates whether to display the send attachment button. Default:true
.attachButtonColor
- Main color of the send attachment buttonattachButtonHighlightColor
- Color of the send attachment button when it's tappedattachButtonImage
-Icon of the send attachment buttonsendButtonColor
- Main color of the send buttonsendButtonHighlightColor
- Color of the send button when tappedsendButtonDisabledColor
- Color of the inactive send buttonsendButtonImage
- Icon of the send button (if specified, it has priority over the configuration of the button that says "Send")sendButtonFont
- Font of the send button (for buttons with no icons)myMessageFont
- Font of the types messagetoolbarInputTextColor
- Message color texttoolbarInputCursorColor
- Cursor color in the message input fieldtoolbarBackgroundColor
- Fill color of the toolbartoolbarTintColor
- Color for highlighting elements in the toolbartoolbarSeparatorLineColor
- Color for separator line of the toolbartoolbarQuotedMessageAuthorFont
- Font for the author's name in a quoted messagetoolbarQuotedMessageFont
- Font for the quoted message texttoolbarQuotedMessageAuthorColor
- Color for the author's name in a quoted messagetoolbarQuotedMessageColor
- Color of the text in a quoted messagetoolbarInputMinimumHeight
- Minimal height of the fieldtoolbarInputMaximumHeight
- Maximal height of the fieldtoolbarInputCornerRadius
- Radius of rounding the corners of the fieldtoolbarInputHasBorder
(true/false) - Attribute that indicates whether the field has borderstoolbarInputBackgroundColor
- Fill color of the field
Appearance of Loading Indicator When Waiting for Agent
waitingSpecialistSpinnerColor
- Loading indicator colorwaitingSpecialistBgColor
- Loading indicator background colorwaitingSpecialistBorderColor
- Loading indicator border colorwaitingSpecialistBorderWidth
- Loading indicator border widthshowWaitingForSpecialistProgress
- Attribute that indicates whether to display the loading indicator while searching for an agent
Appearance of ScrollToBottom
scrollToBottomImage
- icon for button ScrollToBottomscrollToBottomBadgeColor
- background color for unreaded messages count badge above ScrollToBottomscrollToBottomBadgeTextColor
- text color for unreaded messages count badge above ScrollToBottom
General Message Settings
bubbleMessageFont
- Font in message textsbubbleTimeFont
- Font for the time when the message was sentfailedMessageFont
- Font for the warning "The message has not been sent"messageHeaderFont
- Font for the message datequoteAuthorFont
- Font for the name of the author of a quoted messagequoteMessageFont
- Font for the text of a quoted messagequoteTimeFont
- Font for the time of a quoted messagequoteFilesizeFont
- Font for the size of a quoted messagemessageBubbleFilledMaskImage
- Image of the message mask (a PNG file, a filled bubble with a transparent background). If default setting changes, you should correct messageBubbleStrokedMaskImage by new shape.messageBubbleStrokedMaskImage
- Image of the message mask (a PNG file, a border of a bubble with a transparent background)messageContainerLeftOffset
- Shift to right for compensation bubble's handle sizemessageContainerRightOffset
- Shift to left for compensation bubble's handle sizeemptyImageColor
- Color of an empty (not loaded) imagecommonMessageAvatarSize
- Size of the avatar of a non-system message in pt.timeAndStatusBackgroundColor
- Color of the background of the status and time on messages with a picture
System Messages
systemMessageAvatarSize
- Size of the avatar of a system messagespecialisConnectTitleFont
- Font of the text with the name of an assigned agentspecialisConnectSubtitleFont
- Font of additional text below the agent's name ("has joined the chat")specialisConnectTitleColor
- Text color of the name of the assigned agentspecialisConnectSubtitleColor
- Additional text color below the agent's name ("has joined the chat")typingText
- Text for the typing indicator (if it is not set, a standard for a chat animated view will be displayed)scheduleIcon
- Icon of a system message "The chat is unavailable"scheduleAlertColor
- Color of a system message "The chat is unavailable"scheduleAlertFont
- Text color of a system message "The chat is unavailable"scheduleIconBackgroundColor
- Color of the icon for the chat's non-working hours
Incoming Messages
incomingBubbleStroked
- (BOOL) Indicates whether the background of an incoming message needs to be contouredincomingBubbleColor
- Background/contour color of an incoming messageincomingBubbleTextColor
- Incoming message text colorincomingTimeColor
- Color of the time when the incoming message was sentshowIncomingAvatar
- Indicates whether to show the agent's avatar in incoming messagesincomingQuoteSeparatorColor
- Color of the vertical line in the incoming message with a quoteincomingQuoteAuthorColor
- Color of the author's name in the incoming message with a quoteincomingQuoteMessageColor
- Color of the text in the incoming message with a quoteincomingQuoteTimeColor
- Color of the sending time in the incoming message with a quoteincomingQuoteFilesizeColor
- Color of the file size in the incoming message with a quoteincomingFileIconTintColor
- Color of the file icon in the incoming messageincomingFileIconBgColor
- Background of the file download indicator in the incoming messageincomingMediaTimeColor
- Color of the sending time in the incoming messageincomingBubbleLinkColor
- Link color
Outgoing Messages
failedBubbleStroked
- (BOOL) Indicates whether the background of a not sent message needs to be contouredfailedBubbleColor
- Background/contour color of a not sent messageoutgoingBubbleStroked
- (BOOL) Indicates whether the background of an incoming message needs to be contouredoutgoingBubbleColor
- Background/contour color of a sent messageoutgoingBubbleTextColor
- Text color of a sent messageoutgoingTimeColor
- Color of the time when the outgoing message was sentoutgoingPendingStatusColor
,outgoingDeliveredStatusColor
,outgoingReadStatusColor
- Colors of message sending status iconsavatarPlaceholderImage
- Stub for non-existent avatarsoutgoingQuoteSeparatorColor
- Color of the separator in an outgoing message with a quoteoutgoingQuoteAuthorColor
- Color of the author's name in an outgoing message with a quoteoutgoingQuoteMessageColor
- Text of the quote in an outgoing messageoutgoingQuoteTimeColor
- Color of the time when the quoted outgoing message was sentoutgoingQuoteFilesizeColor
- Color of the file size in a quoted outgoing messageoutgoingMediaTimeColor
- Color of the time when the outgoing message was sent with the pictureoutgoingMediaPendingStatusColor
,outgoingMediaDeliveredStatusColor
,outgoingMediaReadStatusColor
- Colors of status icons for sending messages with a pictureoutgoingBubbleLinkColor
- Link colorsoutgoingPendingStatusImage
- (UIImage) Image for the waiting statusoutgoingDeliveredStatusImage
- (UIImage) Image for the delivered statusoutgoingReadStatusImage
- (UIImage) Image for the read status
Voice Messages
voiceRecordingAllowed
- Whether to display the voice message recording buttonvoiceMessageRecordButtonImage
- Icon of the voice message recording buttonvoiceMessageSendButtonImage
- Icon of the send voice message buttonvoiceMessageRecordSendButtonColor
- Color of the icon of the voice message recording/send buttonvoiceMessagePlayImage
- Play button iconvoiceMessagePauseImage
- Pause button iconincomingVoiceMessagePlayPauseColor
- Color of the incoming message play/pause buttonoutgoingVoiceMessagePlayPauseColor
- Color of the outgoing message play/pause buttonpreviewVoiceMessagePlayPauseColor
- Color of the play/pause button of a preview messageincomingVoiceMessageProgressColor
- Color of the part of a listened incoming messageoutgoingVoiceMessageProgressColor
- Color of the part of a listened outgoing messagepreviewVoiceMessageProgressColor
- Color of the part of a listened preview of the messagepreviewVoiceMessageBackgroundColor
- Background color of preview
Images and Indents from Message Edges
imageEdgesActivated
- (Bool) Enables/disables indentation of images inside the bubble messageimageEdges
- (UIEdgeInsets) Structure that defines the indents (top, left, bottom, right)imageCornerRadius
- (CGFloat) Radius at the corners of the image (when theimageEdgesActivated
option is enabled)
Message Search
searchEnabled
- Indicates whether to show the message search button (true
by default)searchScopeBarTintColor
- Color of the highlight of the message search screen scopeBar (switching search modes - messages, images, files)searchBarTextColor
- Search bar text colorsearchBarTintColor
- Search bar tint colorsearchScopeBarFont
- Text font in scopeBarsearchBarTextFont
- Text font in the search barclearSearchIcon
- Icon for the "Clear" button in the search barfindedMessageHeaderTextColor
- Text color in the header of the table with the search resultsfindedMessageHeaderBackgroundColor
- Background of the header of the table with the search resultsfindedMessageHeaderTextFont
- Text font in the header of the table with the search resultsfindMoreMessageTextColor
- Text color in the "Find more" button in the search barfindMoreMessageTextFont
- Text font in the "Find more" button in the search barsearchMessageAuthorTextColor
- Color of the found message author's namesearchMessageTextColor
- Text color of the found messagesearchMessageDateTextColor
- Color of the date when the found message was sentsearchMessageFileTextColor
- Color of the file name in the found messagesearchMessageMatchTextColor
- Color of the "match" of the search query in the text of the found message (if the search query is “hel”, in the message with the text “Hello”, the substring ”hel” will be highlighted in this color)searchMessageAuthorTextFont
- Font of the name of the author of the found messagesearchMessageTextFont
- Font of the text of the found messagesearchMessageDateTextFont
- Font of the date when the found message was sentsearchMessageFileTextFont
- Font of the file name in the found messagesearchMessageMatchTextFont
- Font of the "match" of the search query in the text of the found messagesearchBarIconTintColor
- Color of the search icon in the chat header
Links Preview
linkPreviewEnabled
- (on | off) Preview of links in messages (false
by default)
Sending Photos to Chat
photoPickerBackgroundColor
- PickerSheet background colorphotoPickerSheetTextColor
- Font color in pickerSheet with a list of photosphotoPickerMaxImagesCount
- Max number of photos that a client can send in one message (min 1, max 20, default 10)
Viewing Files and Images
fileViewerNavBarBackgroundColor
- Navbar color on the file/image viewing screenfileViewerNavBarTintColor
- Navbar control colorsfileViewerBackgroundColor
- Background colorfileViewerTitleColor
- Heading colorfileViewerTitleFont
- Heading font
Surveys
surveyTextColor
- Main text color of the surveysurveyTextFont
- Main text font of the surveysurveyCompletionColor
- Color of the survey completion textsurveyCompletionFont
- Font of the survey completion textsurveyCompletionDelay
- Delay in completing the survey in milliseconds during which clients can change their score. Default: 3000.iconStarRatingEmty
- Empty rating icon - pass it as a templateimageWithRenderingMode:UIImageRenderingModeAlwaysTemplate
iconStarRatingFull
- Filled rating icon - pass it as a templateimageWithRenderingMode:UIImageRenderingModeAlwaysTemplate
starRatingColorEnabled
- Color of the filled survey rating iconstarRatingColorDisabled
- Color of the empty survey rating iconstarRatingColorCompleted
- Color of the completed survey rating iconiconLikeEmpty
- Icon of a not selected positive response of a binary survey - pass it as a templateimageWithRenderingMode:UIImageRenderingModeAlwaysTemplate
iconLikeFull
- Icon of a selected positive response of a binary survey - pass it as a templateimageWithRenderingMode:UIImageRenderingModeAlwaysTemplate
iconDislikeEmpty
- Icon of a not selected negative response of a binary survey - pass it as a templateimageWithRenderingMode:UIImageRenderingModeAlwaysTemplate
iconDislikeFull
- Icon of a selected negative response of a binary survey - pass it as a templateimageWithRenderingMode:UIImageRenderingModeAlwaysTemplate
likeRatingColorEnabled
- Color of the selected binary survey response iconlikeRatingColorDisabled
- Color of a not selected binary survey response iconlikeRatingColorCompleted
- Color of the icon of a selected response of a completed binary surveylikeLabelOnStarColor
- Color of the text on a completed survey iconlikeLabelUnderStarColor
- Color of the text below the completed survey icon
Early Completion Survey
closeThreadSurveyText
(deprecated starting with с 3.8.4) - Survey text. Starting from 3.8.4, it has been moved toThreadsLocalizable
. The new key isthreads_request_close_thread_text
.closeThreadSurveyAnswerClose
(deprecated starting with 3.8.4) - Text of the response that closes the request. Starting from 3.8.4, it has been moved toThreadsLocalizable
. The new key isno
.closeThreadSurveyAnswerContinue
(deprecated starting with 3.8.4) - Text of the response that continues the request. Starting from 3.8.4, it has been moved toThreadsLocalizable
. The new key isyes
.
Quick Replies
quickRepliesBlockInput
- Indicates whether to block the message input field if there are quick replies.quickReplyPresentationMode
- Display mode of quick reply buttons. .toolbar - in the pop-up panel, .embed - in the message streamquickReplyAlignment
- Horizontal alignment of quick responses. Center alignment : .center. Left alignment: .left. Right alignment: .right. Default value: .rightquickReplyFont
- Quick reply font textquickReplyBorderCornerRadius
- Radius of rounding the cornersquickReplyBorderColor
- Border colorquickReplyBackgroundColor
- Background colorquickReplyTextColor
- Text colorquickReplyBackgroundColorHighlighted
- Background color when tappedquickReplyTextColorHighLighted
- Text color when tapped
Local Notifications
toastViewTextCopy
- Notification text (String)toastViewTextColor
- Notification text color (UIColor)toastViewBackgroundColor
- Notification background color (UIColor)toastViewSize
- Notification size (CGSize)
Additional Parameters
canShowSpecialistInfo
- Indicates whether the screen with the agent's info can be openednavigationBarVisible
- Header visibility (navbar)customHTTPHeadersForDataStore
-Set of user HTTP headers for datastorehistoryLoadingCount
- Number of messages loaded when requesting the chat historyrefreshColor
- Color of the message loading indicatorscrollToLatest
- Scroll to latest message in chat after getting the history (default is false)
Advanced Settings of Controls
It is possible to fully override appearance settings for some controls:
Send Button
[Threads threads].controls.sendButton
- Message send buttonlet sendButton = UIButton(frame: .zero)
sendButton.backgroundColor = UIColor.lightGray
sendButton.setTitle("Послать", for: .normal)
sendButton.tintColor = (UIColor.blue)
sendButton.setTitleColor(UIColor.red, for: .normal)
sendButton.setTitleColor(UIColor.gray, for: .focused)
sendButton.setTitleColor(UIColor.green, for: .disabled)
sendButton.layer.borderWidth = 1
sendButton.layer.cornerRadius = 4
threads.controls.sendButton = sendButton
Attachment Button
[Threads threads].controls.attachButton
- Message attachment buttonlet frame = CGRect(x: 0, y: 0, width: 60, height: 44)
let attachButton = UIButton(frame: frame)
attachButton.setImage(UIImage(named: "tabBarItemUsers"), for: .normal)
attachButton.tintColor = UIColor.brown
attachButton.backgroundColor = UIColor.lightGray
attachButton.layer.borderWidth = 1
attachButton.layer.cornerRadius = 4
threads.controls.attachButton = attachButton