Customization
Colors
All of the colors and styles used by the SDK are defined in the res/values/bc_styles.xml. You can override the colors for your application by declaring a color in your own styles.xml file defining a color or style with the same name.
Transparency
To set transparency for a chat activity or chat view so the activity or view under it shows through slightly you can get a reference to the BoldChatView object, and set a background color that includes an alpha value.
BoldChatView boldChatView = (BoldChatView)findViewById(R.id.bc_boldchat);
boldChatView.setBackgroundColor(0xEEFFFFFF);
Images
To customize graphics you can add a graphic to your own project with the same name as one used by the Bold360 SDK, and it will override the graphic from the SDK library project.
Labels
All of the labels in the SDK come from the Bold360 servers, and are customized based on the language in use on the phone, and the language the user selects on the pre-chat form. To customize any of these labels it can be done from the Bold360 Admin Center on the Customization tab in the chat window configuration.
Auto-Filling Chat Forms
Before a pre-chat form is presented to a user you can get a callback in your application to allow you to pre-fill values, or to fill out the entire form programmatically. To register for these form callback events add a chat form listener when you are creating your BoldChatSession instance.
private BoldChatSession mBoldChat;
private void inializeBoldChat() {
BoldChatView boldChatView = (BoldChatView)findViewById(R.id.boldchat);
mBoldChat = new BoldChatSession.Builder(boldChatView)
.setChatFormListener(new MyFormListener())
.build();
}
In the implementation of the ChatFormListener interface you can set any of the form values before they are displayed by the user. Return true to show continue showing the form to the user, or false to prevent showing the form.
public class MyFormListener implements BoldChatSession.ChatFormListener {
@Override
public boolean onFormShow(Form form) {
FormField name = form.getFormField("name");
if(name != null) {
name.setValue("Bob Ross");
}
return true;
}
}
Form Field Keys
Name | Type | Description |
---|---|---|
comments | string | Survey comments response value |
custom_[name] | string | Sets the custom field (either pre- or post-chat) with the given name to the given value |
department | string id | The ID of the department of the chat |
string | The email of the customer | |
first_name | string | The name of the customer |
information | string | The customer info value that appears in the client |
initial_question | string | The initial question for the chat (which will show as the first chat message in the chat from the customer) |
knowledge | integer | Survey knowledge response value |
language | string language | Language of the customer (e.g., en-US). If the window does not support the locale, it will fallback to the default language of the window. |
last_name | string | The last name of the customer |
name | string | The name of the customer (synonymous with first_name) |
overall | integer | Survey overall response value |
phone | string | The phone number of the customer |
professionalism | integer | Survey professionalism response value |
reference | string | The customer reference value that appears in the client |
responsiveness | integer | Survey responsiveness response value |