Releases: lithiumtech/ios-brandmessenger-sdk-dist
1.16.2
1.16.1
Changes
- Added the spacing customization support for Sent and Received messages in Brandmessenger iOS SDK.
Sent messages Chat cell customization
// Time Label with default values can be customized
ChatCellPadding.SentMessage.TimeLabel.bottom = 2.0
ChatCellPadding.SentMessage.TimeLabel.right = 10.0
ChatCellPadding.SentMessage.TimeLabel.left = 2.0
// Status View with default values can be customized
ChatCellPadding.SentMessage.StatusView.bottom = 2.0
ChatCellPadding.SentMessage.StatusView.right = 2.0
// Message with default values can be customized
ChatCellPadding.SentMessage.Message.top = 1.0
ChatCellPadding.SentMessage.Message.bottom = 1.0
ChatCellPadding.SentMessage.Message.left = 95.0
ChatCellPadding.SentMessage.Message.lastMessageBottom = 5.0
// Link Preview Message with default values can be customized
ChatCellPadding.SentMessage.LinkPreviewMessage.top = 1.0
ChatCellPadding.SentMessage.LinkPreviewMessage.bottom = 1.0
ChatCellPadding.SentMessage.LinkPreviewMessage.left = 30.0
ChatCellPadding.SentMessage.LinkPreviewMessage.lastMessageBottom = 5.0
// Document with default values can be customized
ChatCellPadding.SentMessage.Document.top = 1.0
ChatCellPadding.SentMessage.Document.bottom = 1.0
ChatCellPadding.SentMessage.Document.left = 57.0
ChatCellPadding.SentMessage.Document.lastMessageBottom = 5.0
// Location with default values can be customized
ChatCellPadding.SentMessage.Location.top = 1.0
ChatCellPadding.SentMessage.Location.bottom = 1.0
ChatCellPadding.SentMessage.Location.width = 250.0
ChatCellPadding.SentMessage.Location.height = 250.0
ChatCellPadding.SentMessage.Location.lastMessageBottom = 5.0
// Video with default values can be customized
ChatCellPadding.SentMessage.Video.top = 1.0
ChatCellPadding.SentMessage.Video.bottom = 1.0
ChatCellPadding.SentMessage.Video.left = 48.0
ChatCellPadding.SentMessage.Video.lastMessageBottom = 5.0
ChatCellPadding.SentMessage.Video.widthRatio = 0.75
// Voice with default values can be customized
ChatCellPadding.SentMessage.Voice.top = 1.0
ChatCellPadding.SentMessage.Voice.bottom = 1.0
ChatCellPadding.SentMessage.Voice.left = 70.0
ChatCellPadding.SentMessage.Voice.lastMessageBottom = 5.0
ChatCellPadding.SentMessage.Voice.height = 55.0
// Image Message with default values can be customized
ChatCellPadding.SentMessage.ImageMessage.top = 1.0
ChatCellPadding.SentMessage.ImageMessage.bottom = 1.0
ChatCellPadding.SentMessage.ImageMessage.left = 58.0
ChatCellPadding.SentMessage.ImageMessage.lastMessageBottom = 5.0
ChatCellPadding.SentMessage.ImageMessage.heightRatio = 0.50
ChatCellPadding.SentMessage.ImageMessage.widthRatio = 0.75
Received Messages Chat cell customization
// Name Label with default values can be customized
ChatCellPadding.ReceivedMessage.NameLabel.top = 6.0
ChatCellPadding.ReceivedMessage.NameLabel.left = 52.0
ChatCellPadding.ReceivedMessage.NameLabel.right = 57.0
// Avatar Image with default values can be customized
ChatCellPadding.ReceivedMessage.AvatarImage.bottom = 0
ChatCellPadding.ReceivedMessage.AvatarImage.height = 37
ChatCellPadding.ReceivedMessage.AvatarImage.width = 37
// Time Label with default values can be customized
ChatCellPadding.ReceivedMessage.TimeLabel.bottom = 2.0
// Message with default values can be customized
ChatCellPadding.ReceivedMessage.Message.top = 1.0
ChatCellPadding.ReceivedMessage.Message.bottom = 1.0
ChatCellPadding.ReceivedMessage.Message.firstMessageTop = 5.0
ChatCellPadding.ReceivedMessage.Message.lastMessageBottom = 5.0
ChatCellPadding.ReceivedMessage.Message.left = 15.0
ChatCellPadding.ReceivedMessage.Message.right = 55.0
// Link Preview Message with default values can be customized
ChatCellPadding.ReceivedMessage.LinkPreviewMessage.top = 1.0
ChatCellPadding.ReceivedMessage.LinkPreviewMessage.bottom = 1.0
ChatCellPadding.ReceivedMessage.LinkPreviewMessage.firstMessageTop = 5.0
ChatCellPadding.ReceivedMessage.LinkPreviewMessage.lastMessageBottom = 5.0
ChatCellPadding.ReceivedMessage.LinkPreviewMessage.left = 15.0
ChatCellPadding.ReceivedMessage.LinkPreviewMessage.right = 10.0
// Video with default values can be customized
ChatCellPadding.ReceivedMessage.Video.top = 1.0
ChatCellPadding.ReceivedMessage.Video.bottom = 1.0
ChatCellPadding.ReceivedMessage.Video.firstMessageTop = 5.0
ChatCellPadding.ReceivedMessage.Video.lastMessageBottom = 5.0
ChatCellPadding.ReceivedMessage.Video.left = 15.0
ChatCellPadding.ReceivedMessage.Video.right = 55.0
ChatCellPadding.ReceivedMessage.Video.widthRatio = 0.80
// Document with default values can be customized
ChatCellPadding.ReceivedMessage.Document.top = 1.0
ChatCellPadding.ReceivedMessage.Document.bottom = 1.0
ChatCellPadding.ReceivedMessage.Document.firstMessageTop = 5.0
ChatCellPadding.ReceivedMessage.Document.lastMessageBottom = 5.0
ChatCellPadding.ReceivedMessage.Document.left = 15.0
ChatCellPadding.ReceivedMessage.Document.right = 55.0
// Location with default values can be customized
ChatCellPadding.ReceivedMessage.Location.top = 1.0
ChatCellPadding.ReceivedMessage.Location.bottom = 1.0
ChatCellPadding.ReceivedMessage.Location.firstMessageTop = 5.0
ChatCellPadding.ReceivedMessage.Location.lastMessageBottom = 5.0
ChatCellPadding.ReceivedMessage.Location.left = 15.0
ChatCellPadding.ReceivedMessage.Location.width = 250.0
ChatCellPadding.ReceivedMessage.Location.height = 250.0
// Voice with default values can be customized
ChatCellPadding.ReceivedMessage.Voice.top = 1.0
ChatCellPadding.ReceivedMessage.Voice.bottom = 1.0
ChatCellPadding.ReceivedMessage.Voice.firstMessageTop = 5.0
ChatCellPadding.ReceivedMessage.Voice.lastMessageBottom = 5.0
ChatCellPadding.ReceivedMessage.Voice.left = 15.0
ChatCellPadding.ReceivedMessage.Voice.right = 30.0
ChatCellPadding.ReceivedMessage.Voice.height = 55.0
// Image Message With default values can be customized
ChatCellPadding.ReceivedMessage.ImageMessage.top = 1.0
ChatCellPadding.ReceivedMessage.ImageMessage.bottom = 1.0
ChatCellPadding.ReceivedMessage.ImageMessage.firstMessageTop = 5.0
ChatCellPadding.ReceivedMessage.ImageMessage.lastMessageBottom = 5.0
ChatCellPadding.ReceivedMessage.ImageMessage.right = 56.0
ChatCellPadding.ReceivedMessage.ImageMessage.left = 15.0
ChatCellPadding.ReceivedMessage.ImageMessage.heightRatio = 0.50
ChatCellPadding.ReceivedMessage.ImageMessage.widthRatio = 0.50
// QuickReply default values can be customized
ChatCellPadding.ReceivedMessage.QuickReply.top = 5.0
ChatCellPadding.ReceivedMessage.QuickReply.bottom = 5.0
ChatCellPadding.ReceivedMessage.QuickReply.firstMessageTop = 5.0
ChatCellPadding.ReceivedMessage.QuickReply.lastMessageBottom = 5.0
ChatCellPadding.ReceivedMessage.QuickReply.left = 15.0
ChatCellPadding.ReceivedMessage.QuickReply.right = 5.0
// Link Message Button with default values can be customized
ChatCellPadding.ReceivedMessage.MessageButton.top = 5.0
ChatCellPadding.ReceivedMessage.MessageButton.bottom = 5.0
ChatCellPadding.ReceivedMessage.MessageButton.firstMessageTop = 5.0
ChatCellPadding.ReceivedMessage.MessageButton.lastMessageBottom = 5.0
ChatCellPadding.ReceivedMessage.MessageButton.left = 15.0
ChatCellPadding.ReceivedMessage.MessageButton.right = 5.0
// Rich Image Message with default values can be customized
ChatCellPadding.ReceivedMessage.RichImageMessage.top = 1.0
ChatCellPadding.ReceivedMessage.RichImageMessage.bottom = 1.0
ChatCellPadding.ReceivedMessage.RichImageMessage.firstMessageTop = 5.0
ChatCellPadding.ReceivedMessage.RichImageMessage.lastMessageBottom = 5.0
ChatCellPadding.ReceivedMessage.RichImageMessage.left = 15.0
ChatCellPadding.ReceivedMessage.RichImageMessage.right = 40.0
ChatCellPadding.ReceivedMessage.RichImageMessage.widthRatio = 0.65
ChatCellPadding.ReceivedMessage.RichImageMessage.heightRatio = 0.65
// Inline Form with default values can be customized
ChatCellPadding.ReceivedMessage.InlineForm.top = 1.0
ChatCellPadding.ReceivedMessage.InlineForm.bottom = 1.0
ChatCellPadding.ReceivedMessage.InlineForm.firstMessageTop = 5.0
ChatCellPadding.ReceivedMessage.InlineForm.lastMessageBottom = 5.0
ChatCellPadding.ReceivedMessage.InlineForm.left = 15.0
ChatCellPadding.ReceivedMessage.InlineForm.right = 10.0
ChatCellPadding.ReceivedMessage.InlineForm.height = 100.0
// Card message with default values can be customized
ChatCellPadding.ReceivedMessage.Card.top = 5.0
ChatCellPadding.ReceivedMessage.Card.bottom = 5.0
ChatCellPadding.ReceivedMessage.Card.left = 15.0
ChatCellPadding.ReceivedMessage.Card.right = 5.0
ChatCellPadding.ReceivedMessage.Card.firstMessageTop = 5.0
ChatCellPadding.ReceivedMessage.Card.lastMessageBottom = 5.0
ChatCellPadding.ReceivedMessage.Card.extraCardWidthPadding = 50.0
For spacing in suggested replies and link buttons use horizontalSpacing
and verticalSpacing
from documentation link here
For Card button spacing check out this documentation link from here
-
Disabled the bitcode in all brand Messenger SDK frameworks to support the latest Xcode 16.0.
-
Removed these image caption styles
ImageBubbleTheme.receivedMessage.captionStyle
andImageBubbleTheme.sentMessage.captionStyle
from SDK -
Custom Regex Support: You can now set a regex pattern to restrict sending user-entered text in the input box.
let regex = "\\b\\d{1,5}\\b" // Example regex for limiting numbers to 1-5 digits
BrandMessengerManager.setRestrictedWordRegex(regex)
Bug fixes:
- Fixed the Location message not showing properly for Agent.
- Fixed the Rich message image bottom UI.
1.16.0
Improvements:
- Added support for Chat accessible with an external Bluetooth keyboard and full keyboard access enabled.
Add this to a Localizable file to customize the voice-over readout.
com.kbm.ConversationVCMessagesContainerAccessibilityName = "Messages";
com.kbm.OpenViewAccessibilityName = "Double tap to open";
- Added Accessibility voice-over announcement for message status: sent or pending.
Add this to a Localizable file to customize the voice-over announcement for message status (sent or pending).
com.kbm.MessageSentAnnouncementAccessibility = "Message sent.";
com.kbm.MessagePendingAnnouncementAccessibility = "Message pending.";
- Added Accessibility voice-over announcement for messages loading.
Add this in a Localizable file to customise the voice-over announcement for message loading
com.kbm.MessagesLoadingAccessibilityName = "Loading, please wait";
- Improved the image loading and caching for attachment image messages.
- Added Accessibility voice-over announcement for typing indicators
Add this in a Localizable file to customise the voice-over announcement for typing indicator
com.kbm.TypingIndicatorAccessibilityName = "Typing";
- Added the disabled voice-over readout announcement to the Send button when it is not active
Add this in a Localizable file to customise the voice-over readout for the Send button
com.kbm.SendButtonAccessibilityLabelName = "Send, Button";
com.kbm.SendButtonDisabledAccessibilityLabelName = "Send, Button, disabled";
-
Clicking the suggested replies button will focus on the new sent message when voice-over is enabled.
-
Navigation title, dates, and unread marker announced as headings.
-
Improved rich message Link buttons voice-over read-out
Add this in a Localizable file to customise the voice-over readout for the rich message Link button
com.kbm.OpensInExternalBrowserAccessibilityText = "Link, Opens in external browser";
- Added the voice-over read-out for the conversation or pinned header.
Add this to a Localizable file to customize the voice-over for the conversation or pinned header.
com.kbm.LinksOpensInExternalBrowserAccessibilityText = "Links open in external browser.";
Bug fixes:
- Multiple image/video messages will be sent in order.
- Fixed a bug where display-conditions was not checking rule-level conditions
1.15.0
Changes:
- Read/delivered configuration from care for widgetId is set on the client.
- Moved attachment options to the More Options menu.
- Enhanced camera video/photo flow.
- Improved typing indicators UI.
Update your typing-view styles:
// Dots Animation duration in TimeInterval seconds.
config.chatBar.typingViewStyle.animationDuration = 1.2
// Made Dots view background color now. Before it was typing-view background color.
config.chatBar.typingViewStyle.backgroundColor = .black
- Implemented an in-app player for Vimeo videos.
- Moved the business image to the navigation header.
- Added unread message marker in chat.
- Enhanced file message UI.
- Added inline forms in chat.
- Added accessibility support for bold text.
Removed:
- We removed contact permission handling from the SDK. Find
<key>NSContactsUsageDescription</key>
in your info.plist, you can safely remove it now.
Breaking changes:
- Added a new parameter called
fontName
to theStyle
object. Pass the font name of the UIFont usingmyFontObject.fontName
Before:
let myFont = UIFont.systemFont(ofSize: 12)
Style(font: myFont, // Set font
text: UIColor.red, // Text color
defaultFontSize: 12, // Set the default font size not the scaled font size here
fontTextStyle: .body) // Set the UIFont.TextStyle which will be used for dynamic scaling text
After:
let myFont = UIFont.systemFont(ofSize: 12)
Style(font: myFont, // Set font
text: UIColor.red, // Text color
defaultFontSize: 12, // Set the default font size not the scaled font size here
fontTextStyle: .body, // Set the UIFont.TextStyle which will be used for dynamic scaling text
fontName: myFont.fontName) // New: Set the UIFont name here.
-
Moved API call completion handler response callbacks and NotificationCenter observer callbacks to async global background threads. Ensure to wrap your UI code in the main thread
DispatchQueue.main.async { }
-
We've removed the below typing-view style configurations
config.chatBar.typingViewStyle.typingViewMinimumHeight = 40.0
config.chatBar.typingViewStyle.hideTypingString = true
config.chatBar.typingViewStyle.animationImages = animationImages
1.14.5
Changes:
- Added Privacy manifest files to the SDK to meet Apple's requirement of describing data collected and use of required reason API.
- Added the digital signature to BrandMessenger SDK xcframeworks.
1.14.4
Bug fixes:
- Fixed bug where message list was not paginating to the next page in the case where the last message was a suggested reply without message text.
1.14.3
What's new 🔥:
- A11y improvements:
- When suggested replies are selected, the focus will move to the input field.
- Improved VoiceOver experience: Now, VoiceOver distinguishes between link buttons and regular buttons.
- When a new message arrives, it will announce a new message arrived while on the chat screen. In the
Localizable.strings
file, add the below value to change default value of the voice-over readout.com.kbm.ReceivedNewMessageAnnouncementAccessibility = "New message arrived.";
- Card Images will be in rounded corners.
- Added line breaks in the card description. Use "\n" as a line-breaking character.
1.14.2
Changes:
- When voice-over accessibility enabled for card button now announces the selected or unselected button to distinguish between buttons.
In the Localizable.strings file, add the below values to change the default values of voice-over readout.
com.kbm.UnselectedButtonAccessibility = "unselected";
com.kbm.SelectedButtonAccessibility = "selected";
- Added some more Voice-over accessibility localisable strings
// For header logo
com.kbm.BusinessLogoAccessibility = "Logo";
// Gallery photo or video select
com.kbm.GalleryVideoAccessibility = "Video";
com.kbm.GalleryPhotoAccessibility = "Photo";
Breaking changes:
- In Style added two new parameters
defaultFontSize
andfontTextStyle
.
In thedefaultFontSize
pass the default font size not scaled font size and infontTextStyle
which is a type ofUIFont.TextStyle
set any style as this is required for dynamic scaling the font size based on this.
Before:
Style(font: UIFont.systemFont(ofSize: 13), text: .white, linkTextColor: .red)
After:
Style(font: UIFont.systemFont(ofSize: 12), // Set font
text: UIColor.red, // Text color
defaultFontSize: 12, // Set the default font size not the scaled font size here
fontTextStyle: .body) // Set the UIFont.TextStyle which will be used for dynamic scaling text
- Rich message accessibility label text is updated if you have added it before in your
Localizable.strings
file then you need to update.
// Cards voice over readout
com.kbm.ReceivedMessageCards = "Cards %@ by %@ at %@";
com.kbm.SentMessageCards = "Your cards %@ at %@, %@";
// Suggested replies button voice over readout
com.kbm.ReceivedMessageQuickReply = "Suggested replies %@ by %@ at %@";
com.kbm.SentMessageQuickReply = "Your suggested replies %@ at %@, %@";
// Link button voice over readout
com.kbm.ReceivedMessageButton = "Button %@ by %@ at %@";
com.kbm.SentMessageButton = "Your button %@ at %@, %@";
Bug Fixes 🔧 :
- Fixed accessibility text scaling issues when app is closed or if user is on a different screen
- Fixed an issue where the send button was showing S..d when large max is selected
- Fixed the voice-over accessibility issues.
1.14.1
Bug Fixes 🔧 :
- Fixed a crash when downgrading the SDK version.
1.14.0
New Features 🔥 :
- Emoji Picker.
You can enable using the below configuration:
var config = KBMConfiguration()
config.chatBar.hideEmojiButton = false
BrandMessengerManager.setDefaultConfiguration(config)
- If you have set the widget-Id, you can use this method to show the conversation. It also internally retrieves the Care configuration.
BrandMessengerManager.show { error in }
BrandMessengerManager.showWithWelcome { error in }
- Added a method to close the conversation screen
BrandMessengerManager.dismiss()
- Added ContentFiltering i.e scrubbing of message content based on regexes coming from the care dashboard After setting widget Id, content redaction can be configured by the Care Admin. More details here.
- Videos can now be played without downloading (streamed). Once downloaded, they will play normally.
- Added displayCondition for device geo-location and IP address. You can blacklist and whitelist countries and IPs from Care dashboard under admin panel -> modern chat -> select widget.
BrandMessengerManager.isDeviceGeoIPAllowed { isDeviceGeoIPAllowed, error in }
- Added displayCondition for device throttling. You can set throttling percentage from care dashboard under admin panel -> modern chat -> select widget.
BrandMessengerManager.shouldThrottle { shouldThrottle, error in }
-
Added retrieving brand themes (chat colour etc.) from the care config and applying them to the SDK. More details here.
-
Link Preview UI improvements.
-
Added IN-APP YouTube videos playback.
-
Added feature to request a transcript of chat to email-id. Configurable from SDK side as well by config if widget-id is not set.
config.hideEmailTranscript = false
-
Audio message view UI and functional improvements.
-
Added “check” icon to selected card rich message button.
-
Add multi-line and word-wrap support to rich message card text.
-
Added header business-name, intro and header logo to the conversation screen. Can be configured from Care. More details here.
If widget-id is not set you can set the business logo:
System header view business logo image config:
config.headerViewConfiguration.businessProfileImage = UIImage(named: "<YOUR-IMAGE-NAME>")
Pinned header view business logo image config:
config.pinnedHeaderConfig.businessProfileImage = UIImage(named: "<YOUR-IMAGE-NAME>")
- Added translation for header text from Care. More details here.
Breaking change:
- Renamed the class variables in the configuration of config.pinnedHeaderConfig and config.headerViewConfiguration.
Scrollable System Message:
var config = KBMConfiguration()
/// Set text color of header text
config.headerViewConfiguration.textColor = UIColor.brown
/// Set padding to header text
config.headerViewConfiguration.padding = UIEdgeInsets(top: 12, left: 10, bottom: 0, right: 12)
/// Set line spacing between header text lines
config.headerViewConfiguration.lineSpacing = 2.0
/// Set paragraph spacing between header
config.headerViewConfiguration.paragraphSpacing = 7.0
/// Set text style to header text
config.headerViewConfiguration.textStyle = Style(
font: UIFontMetrics(forTextStyle: .footnote).scaledFont(for: UIFont.font(.normal(size:
12))),
text: .text(.black00)
)
/// Set text color to link text
config.headerViewConfiguration.linkTextColor = UIColor.red
/// Set color of underline of link text
config.headerViewConfiguration.linkUnderlineColor = UIColor.red
/// Set custom icon to header
config.headerViewConfiguration.headerIcon = UIImage(named: "<your-image>")
/// Set width to custom icon
config.headerViewConfiguration.iconWidth = 10
/// Set height to custom icon
config.headerViewConfiguration.iconHeight = 10
BrandMessengerManager.setDefaultConfiguration(config)
Pinned System Message:
var config = KBMConfiguration()
/// Set whether to hide or display pinned header, default is true, here set to false
config.hidePinnedSystemMessageHeader = false
/// Set customicon to header
config.pinnedHeaderConfig.pinnedSystemMessageIcon = UIImage(named: "<your-image-name>")
/// Set text color to header text
config.pinnedHeaderConfig.textColor = .black
/// Set padding to header text
config.pinnedHeaderConfig.padding = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
/// Set line spacing between header text lines
config.pinnedHeaderConfig.lineSpacing = 2.0
/// Set paragraph spacing
config.pinnedHeaderConfig.paragraphSpacing = 7.0
/// Set text style to header text
config.pinnedHeaderConfig.textStyle = Style(
font: UIFontMetrics(forTextStyle: .footnote).scaledFont(for: UIFont.font(.normal(size:
12))),
text: .text(.white)
)
/// Set icon width to custom icon
config.pinnedHeaderConfig.iconWidth = 10.0
/// Set icon height to custom icon
config.pinnedHeaderConfig.iconHeight = 10.0
/// Set text color to link text
config.pinnedHeaderConfig.linkTextColor = .red
/// Set color to underline of link text
config.pinnedHeaderConfig.linkUnderlineColor = .brown
BrandMessengerManager.setDefaultConfiguration(config)
Bug Fixes 🔧 :
- Pending message not being sent after app kill and for in-memory.
- Cannot send attachments in offline mode.
- Lint warning fix.
- Message delivery UI not updating in some cases.
- Card image ratio fixed to 3:2, ratios other than these would add letterboxing to the image.