Customization
Theme Customization
In this section we have explained about the configuration options present in the SDK to modify color, font etc.
You can override any of the properties from the default configuration. Doing it in your AppDelegate is preferred.
Conversation Screen Background Color
Background color of the Conversation screen
Kommunicate.defaultConfiguration.backgroundColor = UIColor.white
Received Message Background Color
The background color of the received message bubble.
KMMessageStyle.receivedBubble.color = UIColor.lightGray
Sent Message Background Color
The background color of the sent message bubble.
KMMessageStyle.sentBubble.color = UIColor.lightGray
Text view style
Change the placeholder style
KMChatBarConfiguration.TextView.placeholder = KMStyle(font: .font(.normal(size: 16)), text: .red)
Change the text style
KMChatBarConfiguration.TextView.text = KMStyle(font: .font(.normal(size: 18)), text: .red)
Message Text Font and Color
Use this for changing message text font and color in the Conversation screen.
Navigation Bar's Color Customization
Use the below UINavigationBar.appearance
code to change the navigation bar colors while launching the conversation.
FAQ Button
To hide the FAQ button in Conversation List or Conversation screen, use below setting
Attachment Options
To hide all the attachment options(gallery, camera, video, contact, document and location), use optionsToShow
config as shown below. All will be shown by default except contact.
We also have the option to record and send an audio message. To hide this option use hideAudioOptionInChatBar
config.
Sending additional metadata with messages
If you want to send additional metadata with all the messages(sent from a device) then use messageMetadata
config in your AppDelegate like this:
Enable Speech to Text
The quality of the customer journey is everything in a product. STT will help you in enhancing the user experience and people with different learning styles prefer using these features, which is supported on iOS SDK. The Speech-to-Text feature can be enabled using the below setting:
This feature is disabled by default, to enable it, add the below script in the bottom of the Podfile and run pod install
:
Also add this Speech recognition usage entry in the project's Info.plist(open it as Source Code) file:
Pass custom data to bot platform
To pass custom data with all the messages to the bot platform, use updateChatContext
config as shown below:
Make your bot multilingual
If you want to set a user's language(to get bot replies in that language), then use updateUserLanguage
config as shown below:
Last updated