Pass NowChatConfiguration to modify the behavior of NowChat
reference australia Updated Sep 10, 2026 1 min read mobsdk-and-chat_options.md
You can pass an optional NowChatConfiguration parameter when starting a chat session to modify some of the behavior of NowChat.
The NowChatConfiguration object contains the following options:
- closePrompt: Prompt text that appears before exiting a chat window. You define this prompt text through the following parameters:
- header: Nullable string value that appears on the prompt’s header.
- message: String value that appears on the prompt’s main body.
- acceptButtonTitle: String value that appears on the primary button of the prompt. This button closes the chat window.
- declineButtonTitle: String value that appears on the secondary button of the prompt. This button dismisses the prompt without closing the chat window.
- disabledFeatures: List of NowChat features to disable. Refer to the NowChatConfiguration.Feature enum class for the list of features that you can disable.
- conversationOptions: List of conversation options to apply to NowChat. Refer to the NowChatConvestation.ConversationOption enum class for the list of options that you can apply.
- uiConfiguration: UIConfiguration value used to configure UI components in NowChat.
The following code example shows how to use NowChatConfiguration() to configure NowChat.
JavaScript
class MainActivity : AppCompatActivity() { @Inject
lateinit var sdkManager: SdkManager override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) //Drawable to use instead of the default NowChat back button. val myDrawable = ContextCompat.getDrawable(activity, R.drawable.my_drawable) val nowChatConfiguration = NowChatConfiguration( closePrompt = NowChatConfiguration.ClosePrompt( header = null, message = "Are you sure you want to leave?", acceptButtonTitle = "Yes", declineButtonTitle = "No" ), disabledFeatures = listOf(NowChatConfiguration.Feature.START_NEW_CONVERSATION), conversationOptions = listOf(NowChatConfiguration.ConversationOption.FORCE_NEW_CONVERSATION), uiConfiguration = NowChatConfiguration.UIConfiguration( closeButton = NowChatConfiguration.CloseButton( icon = myDrawable ), attachmentUploadButton = NowChatConfiguration.AttachmentUploadButton(isVisible = false) ) ) //Start NowChat lifecycleScope.launch { sdkManager.getNowChatService()?.start(this@MainActivity, nowChatConfiguration = nowChatConfiguration) } }}For additional information, see NowChatConfiguration class - Android and NowChatService - start(activity: Activity, themeColors: NowChatTheme = object: NowChatTheme{}, contextData: Map<String, Any> = mapOf(), chatConfiguration: NowChatConfiguration? = null).
71 lines · 3.8 KB
---
title: Pass NowChatConfiguration to modify the behavior of NowChat
description: You can pass an optional NowChatConfiguration parameter when starting a chat session to modify some of the behavior of NowChat.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/developer-guides/mobsdk-and-chat\_options.html
release: australia
product: Developer Guides
classification: developer-guides
topic_type: reference
last_updated: "2026-09-10"
reading_time_minutes: 1
breadcrumb: [Implement Virtual and Live Agent chat, Mobile SDK Developer Guide - Android, Developer guides, API implementation and reference]
---
# Pass NowChatConfiguration to modify the behavior of NowChat
You can pass an optional **NowChatConfiguration** parameter when starting a chat session to modify some of the behavior of NowChat.
The NowChatConfiguration object contains the following options:
- **closePrompt**: Prompt text that appears before exiting a chat window. You define this prompt text through the following parameters:
- **header**: Nullable string value that appears on the prompt’s header.
- **message**: String value that appears on the prompt’s main body.
- **acceptButtonTitle**: String value that appears on the primary button of the prompt. This button closes the chat window.
- **declineButtonTitle**: String value that appears on the secondary button of the prompt. This button dismisses the prompt without closing the chat window.
- **disabledFeatures**: List of NowChat features to disable. Refer to the NowChatConfiguration.Feature enum class for the list of features that you can disable.
- **conversationOptions**: List of conversation options to apply to NowChat. Refer to the NowChatConvestation.ConversationOption enum class for the list of options that you can apply.
- **uiConfiguration**: UIConfiguration value used to configure UI components in NowChat.
The following code example shows how to use NowChatConfiguration\(\) to configure NowChat.
```
class MainActivity : AppCompatActivity() {
@Inject
lateinit var sdkManager: SdkManager
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//Drawable to use instead of the default NowChat back button.
val myDrawable = ContextCompat.getDrawable(activity, R.drawable.my_drawable)
val nowChatConfiguration = NowChatConfiguration(
closePrompt = NowChatConfiguration.ClosePrompt(
header = null,
message = "Are you sure you want to leave?",
acceptButtonTitle = "Yes",
declineButtonTitle = "No"
),
disabledFeatures = listOf(NowChatConfiguration.Feature.START_NEW_CONVERSATION),
conversationOptions = listOf(NowChatConfiguration.ConversationOption.FORCE_NEW_CONVERSATION),
uiConfiguration = NowChatConfiguration.UIConfiguration(
closeButton = NowChatConfiguration.CloseButton(
icon = myDrawable
),
attachmentUploadButton = NowChatConfiguration.AttachmentUploadButton(isVisible = false)
)
)
//Start NowChat
lifecycleScope.launch {
sdkManager.getNowChatService()?.start(this@MainActivity, nowChatConfiguration = nowChatConfiguration)
}
}
}
```
For additional information, see [NowChatConfiguration class - Android](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowChatOptionsAndroid.md) and [NowChatService - start\(activity: Activity, themeColors: NowChatTheme = object: NowChatTheme\{\}, contextData: Map<String, Any> = mapOf\(\), chatConfiguration: NowChatConfiguration? = null\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowChatServiceAndroidAPI.md).
| title | Pass NowChatConfiguration to modify the behavior of NowChat |
| description | You can pass an optional NowChatConfiguration parameter when starting a chat session to modify some of the behavior of NowChat. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/australia/api-reference/developer-guides/mobsdk-and-chat\_options.html |
| release | australia |
| product | Developer Guides |
| classification | developer-guides |
| topic_type | reference |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Implement Virtual and Live Agent chatMobile SDK Developer Guide - AndroidDeveloper guidesAPI implementation and reference |