---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/api-reference

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# NowChatConfiguration class - iOS

# NowChatConfiguration class - iOS {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 6 minutes to read  
Configures options on a chat session.  
Use cases:

* Showing a prompt before closing a chat window.
* Turning off features while using chat.
* Applying conversation options when using chat.
* Configuring UI components in NowChat.
{#NowChatOptionsiOS__ul_jnb_hsc_zjc}

Use NowChatConfiguration properties to integrate NowVoice with NowChat.  
{#NowChatOptionsiOS__table_vx2_klw_nv1__entry__3}

| Name | Type | Description |
|-|-|-|
| voiceConfiguration | [NowVoiceEndpoint?](https://servicenow-prod.fluidtopics.net/m55d7vaox0r2Gr3AEw73tQ "Describes a voice agent endpoint.") | The voice endpoint for the in-chat voice button. When `nil`, uses the first endpoint in your ServiceNow instance's Mobile SDK settings. |
| voiceUIConfiguration | [NowVoiceUIConfiguration?](https://servicenow-prod.fluidtopics.net/qISbY0cot76Z3Si6Upxb7w#NowVoiceUIConfigiOSStruct "Specifies presentation options for the voice agent UI.") | Presentation options to apply to the voice UI launched from within chat. |
| voiceCallbacks | [NowVoiceCallbacks?](https://servicenow-prod.fluidtopics.net/It4LuxELDVwrTKjmLLuGjg#NowVoiceCallbacksiOSStruct "Specifies callbacks for voice session lifecycle and content events.") | Callbacks for voice sessions launched from within chat. |
[Table 1. Properties]

{#NowChatOptionsiOS__table_vx2_klw_nv1}

When these properties are set, a voice button appears in the NowChat UI. Tapping it launches the voice agent UI as a full-screen overlay within the chat flow. The [onCallEnded callback](https://servicenow-prod.fluidtopics.net/It4LuxELDVwrTKjmLLuGjg#NVoiceCallbacks-init_B_O_O "Creates a NowVoiceCallbacks instance with the specified voice session event handlers.") is invoked when the voice session ends, returning the user to the chat.

## NowChatConfiguration - NowChatConfiguration(closePrompt: ClosePrompt?, disabledFeatures: \[Feature\]? = nil, conversationOptions: \[ConversationOption\]? = nil, uiConfiguration: UIConfiguration? = nil) {#ariaid-title2}

Configures options for the current chat session. This method enables you to show a prompt before closing a chat window, disable features while using chat, apply different conversation options when using chat, and configure UI
components in NowChat.
{#NChatOp-NowChatOptions_O_O_B__table_lpt_3lk_kbc__entry__3}

| Name | Type | Description |
|-|-|-|
| closePrompt | [ClosePrompt?](https://servicenow-prod.fluidtopics.net/6O7zLRurtue2bQk8MVsndw#NChatOp-ClosePrompt_S_S_S_S "Creates and returns a ClosePrompt object based on the passed parameters. You then pass this object into the NowChatConfiguration() constructor to configure the close prompt options within a chat session.") | Prompt to display before closing the associated chat window. Call the [NowChatConfiguration.ClosePrompt()](https://servicenow-prod.fluidtopics.net/6O7zLRurtue2bQk8MVsndw#NChatOp-ClosePrompt_S_S_S_S "Creates and returns a ClosePrompt object based on the passed parameters. You then pass this object into the NowChatConfiguration() constructor to configure the close prompt options within a chat session.") struct to define the value of this parameter. For example: closePrompt = NowChatConfiguration.ClosePrompt( header = nil, message = "Are you sure you want to leave?", acceptButtonTitle = "Yes", declineButtonTitle = "No" ) If you don't want to display a close prompt, omit the closePrompt argument in the NowChatConfiguration() call. |
| disabledFeatures | \[NowChatConfiguration.​Feature\]? | List of chat features to disable within the current chat session. Valid value: startNewConversation - Hide/disable the StartNew Conversation button that appears in a chat window. The available chat features are defined in the NowChatOptions.Feature enum class. For example: let disabledFeatures: [NowChatConfiguration.Feature]? = [.startNewConversation] If you don't want to disable any features, omit the disabledFeatures argument in the NowChatConfiguration() call. |
| conversationOptions | \[NowChatConfiguration.​ConversationOption\]? | List of conversation options to apply to NowChat. Valid values: * endConversationOnExit: Ongoing conversation is terminated when exiting the NowChat window. * forceNewConversation: Forces a new chat conversation when NowChat starts. {#NChatOp-NowChatOptions_O_O_B__ul_qmr_mdc_fdc} The available conversation options are defined in the NowChatConfiguration.ConversationOption enum class. For example: let conversationOptions: [NowChatConfiguration.ConversationOption]? = [.endConversationOnExit, .forceNewConversation] If you don't want to disable any features, omit the conversationOptions argument in the NowChatConfiguration() call. |
| uiConfiguration | [UIConfiguration?](https://servicenow-prod.fluidtopics.net/6O7zLRurtue2bQk8MVsndw#NChatCnfg-UIConfig_O_O "Creates and returns a UIConfiguration object based on the passed parameters. You then pass this object into the NowChatConfiguration() constructor to configure UI components in NowChat.") | UIConfiguration values to use to configure UI components in NowChat. Valid values: * attachmentUploadButton: Configuration for the `AttachmentUploadButton` that is shown next to the text input while talking with a live agent. * closeButton: Configuration for the `CloseButton` used for back navigation on the NowChat toolbar. For example: let attachmentUploadButton = NowChatConfiguration.AttachmentUploadButton(isVisible: false) // Default isVisible = true // Configure close button as Text let closeButtonText: NowChatConfiguration.CloseButtonType = .text("Exit") let uiConfigurationWithText = NowChatConfiguration.UIConfiguration(closeButton: closeButtonText) // Configure close button as image let buttonImage = UIImage(systemName: "arrow.left.circle") ?? nil var closeButtonImage: NowChatConfiguration.CloseButtonType? if let buttonImage { closeButtonImage = .image(buttonImage) } let uiConfigurationWithImage = NowChatConfiguration.UIConfiguration(closeButton: closeButtonImage) If you want to use custom images instead of the provided system images, the images should be between 22 to 44 pixels in width and 30 pixels in height, for optimal resolution. To use the default for either AttachmentUploadButton or CloseButtonType, omit the associated button from the UIConfiguration argument. To use the default for both buttons, omit the UIConfiguration parameter in the NowChatConfiguration() call. |
[Table 2. Parameters]

{#NChatOp-NowChatOptions_O_O_B__table_lpt_3lk_kbc} {#NChatOp-NowChatOptions_O_O_B__table_mpt_3lk_kbc__entry__2}

| Type | Description |
|-|-|
| NowChatConfiguration | Returns a NowChatConfiguration object that you can pass when calling the [NowChatConfiguration()](https://servicenow-prod.fluidtopics.net/6O7zLRurtue2bQk8MVsndw#NChatOp-NowChatOptions_O_O_B "Configures options for the current chat session. This method enables you to show a prompt before closing a chat window, disable features while using chat, apply different conversation options when using chat, and configure UI components in NowChat.") method. |
[Table 3. Returns]

{#NChatOp-NowChatOptions_O_O_B__table_mpt_3lk_kbc}  
The following code example shows how to call this method to configure the chat UI.

    func makeChatScreen() -> UIViewController? {
      let closePrompt = NowChatConfiguration.ClosePrompt(
        header: nil,
        message: "Are you sure you want to leave?",
        acceptButtonTitle: "Yes",
        declineButtonTitle: "No"
      )

      let disabledFeatures: [NowChatConfiguration.Feature]? = [.startNewConversation]

      let conversationOptions: [NowChatConfiguration.ConversationOption]? = [.endConversationOnExit, .forceNewConversation] 

      let attachmentUploadButton = NowChatConfiguration.AttachmentUploadButton(isVisible: false) 

      // Configure close button as Text
      let closeButtonText: NowChatConfiguration.CloseButtonType = .text("Exit")
      let uiConfigurationWithText = NowChatConfiguration.UIConfiguration(closeButton: closeButtonText, attachmentUploadButton: attachmentUploadButton) 
     
      // Configure close button as image 
      let buttonImage = UIImage(systemName: "arrow.left.circle") ?? nil 

      var closeButtonImage: NowChatConfiguration.CloseButtonType?
      if let buttonImage {
        closeButtonImage = .image(buttonImage)
      }
      let uiConfigurationWithImage = NowChatConfiguration.UIConfiguration(closeButton: closeButtonImage, attachmentUploadButton: attachmentUploadButton)    

      let chatConfiguration = NowChatConfiguration(closePrompt: closePrompt, 
        disabledFeatures: disabledFeatures,
        conversationOptions: conversationOptions,
        uiConfiguration: uiConfigurationWithImage)

      let result = chatService.makeChatUI(theme: CarrascoChatTheme(chatColors: ChatColors()), chatConfiguration: chatConfiguration)  

      switch result { 
        case .success(let chatViewController):
          return chatViewController
        case .failure(let error):
          debugPrint("Chat screen creation failed with error: \(error)")
          return nil
      }
    }

## NowChatConfiguration - AttachmentUploadButton(isVisible: Boolean = true) {#ariaid-title3}

Defines the UI configurations to apply to the upload attachment button that appears next to the text input while talking with a live agent.
AttachmentUploadButton is a struct of the NowChatConfiguration class.
{#NChatCnfg-AttachUploadButton_B__table_tym_brc_fdc__entry__3}

| Name | Type | Description |
|-|-|-|
| isVisible | Boolean | Flag that indicates the visibility of the upload attachment button. Valid values: * true: Upload attachment button is visible. * false: Upload attachment button is hidden. Default: true |
[Table 4. Parameters]

{#NChatCnfg-AttachUploadButton_B__table_tym_brc_fdc} {#NChatCnfg-AttachUploadButton_B__table_uym_brc_fdc__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 5. Returns]

{#NChatCnfg-AttachUploadButton_B__table_uym_brc_fdc}  
The following code example shows how to hide the AttachmentUploadButton.

    func makeChatScreen() -> UIViewController? {
      let attachmentUploadButton = NowChatConfiguration.AttachmentUploadButton(isVisible: false)
      let uiConfigurationWithAttachmentButton = NowChatConfiguration.UIConfiguration(attachmentUploadButton: attachmentUploadButton)         

      let chatConfiguration = NowChatConfiguration(uiConfiguration: uiConfigurationWithAttachmentButton) 

      let result = chatService.makeChatUI(theme: CarrascoChatTheme(chatColors: ChatColors()), chatConfiguration: chatConfiguration) 

      switch result {
        case .success(let chatViewController):
          return chatViewController
        case .failure(let error):
          debugPrint("Chat screen creation failed with error: \(error)")
          return nil
      }
    }

## NowChatConfiguration - ClosePrompt(header: String?, message: String, acceptButtonTitle: String, declineButtonTitle: String) {#ariaid-title4}

Creates and returns a ClosePrompt object based on the passed parameters. You then pass this object into the NowChatConfiguration() constructor to configure the close prompt options within a chat
session.
{#NChatOp-ClosePrompt_S_S_S_S__table_xb2_dcl_kbc__entry__3}

| Name | Type | Description |
|-|-|-|
| header | String | Text to display on the prompt's header. If you don't want to display a prompt header, pass "nil". |
| message | String | Text to display as the prompt's main text. |
| acceptButtonTitle | String | Text to display on the prompt's primary button for closing the chat window. |
| declineButtonTitle | String | Text to display on the prompt's secondary button that dismisses the prompt. |
[Table 6. Parameters]

{#NChatOp-ClosePrompt_S_S_S_S__table_xb2_dcl_kbc}  
The following code example shows how to call this function.

    func makeChatScreen() -> UIViewController? {
      guard let chatService = chatService else { return nil }
      let closePrompt = NowChatOptions.ClosePrompt(
        header: "Close Window",
        message: "Are you sure you want to close the chat window?",
        acceptButtonTitle: "Yes",
        declineButtonTitle: "No")

      let disabledFeatures = [.startNewConversation]
        
      let chatOptions = NowChatOptions(closePrompt: closePrompt,
        disabledFeatures: disabledFeatures,
        forceNewConversation: true)
        
      let result = chatService.makeChatUI(theme: CarrascoChatTheme(chatColors: ChatColors()), chatOptions: chatOptions)
        
      switch result {
      case .success(let chatViewController):
        return chatViewController
      case .failure(let error):
        return nil
      }
    }

## NowChatConfiguration - UIConfiguration(closeButton: CloseButtonType? = nil, attachmentUploadButton: AttachmentUploadButton? = nil) {#ariaid-title5}

Creates and returns a UIConfiguration object based on the passed parameters. You then pass this object into the NowChatConfiguration() constructor to configure UI components in NowChat.
UIConfiguration() is a struct of the NowChatConfiguration class.
{#NChatCnfg-UIConfig_O_O__table_fwq_z3j_fdc__entry__3}

| Name | Type | Description |
|-|-|-|
| closeButton | CloseButtonType? | Configuration for the `CloseButtonType` that appears on the NowChat toolbar and is used for back navigation. Valid values: * image (UIImage): Create a close button with an image. * text (String): Create a close button as text. Use this to pass a custom name for the back button. The available `CloseButtonType` options are defined in the NowChatConfiguration.CloseButtonType enum class. For example: func makeChatScreen() -> UIViewController? { // Configure close button as Text let closeButtonText: NowChatConfiguration.CloseButtonType = .text("Exit") let uiConfigurationWithText = NowChatConfiguration.UIConfiguration(closeButton: closeButtonText) // Configure close button as image let buttonImage = UIImage(systemName: "arrow.left.circle") ?? nil var closeButtonImage: NowChatConfiguration.CloseButtonType? if let buttonImage { closeButtonImage = .image(buttonImage) } let uiConfigurationWithImage = NowChatConfiguration.UIConfiguration(closeButton: closeButtonImage) let chatConfiguration = NowChatConfiguration(uiConfiguration: uiConfigurationWithImage) // or // let chatConfiguration = NowChatConfiguration(uiConfiguration: uiConfigurationWithText) |
| attachmentUploadButton | [AttachmentUploadButton?](https://servicenow-prod.fluidtopics.net/6O7zLRurtue2bQk8MVsndw#NChatCnfg-AttachUploadButton_B "Defines the UI configurations to apply to the upload attachment button that appears next to the text input while talking with a live agent.") | Configuration for the `AttachmentUploadButton` that is shown next to the text input while talking with a live agent. Call the [NowChatConfiguration - AttachmentUploadButton(isVisible: Boolean = true)](https://servicenow-prod.fluidtopics.net/6O7zLRurtue2bQk8MVsndw#NChatCnfg-AttachUploadButton_B "Defines the UI configurations to apply to the upload attachment button that appears next to the text input while talking with a live agent.") method to define the value of this parameter. For example: let attachmentUploadButton = NowChatConfiguration.AttachmentUploadButton(isVisible: false) let uiConfigurationWithAttachmentButton = NowChatConfiguration.UIConfiguration(attachmentUploadButton: attachmentUploadButton) let chatConfiguration = NowChatConfiguration(uiConfiguration: uiConfigurationWithAttachmentButton) |
[Table 7. Parameters]

{#NChatCnfg-UIConfig_O_O__table_fwq_z3j_fdc} {#NChatCnfg-UIConfig_O_O__table_gwq_z3j_fdc__entry__2}

| Type | Description |
|-|-|
| Object | UI configuration object |
[Table 8. Returns]

{#NChatCnfg-UIConfig_O_O__table_gwq_z3j_fdc}  
The following code example shows how to call the UIConfiguration() subclass to set the chat UI configuration.

    func makeChatScreen() -> UIViewController? {

      let attachmentUploadButton = NowChatConfiguration.AttachmentUploadButton(isVisible: false)

      // Configure close button as image
      let buttonImage = UIImage(systemName: "arrow.left.circle") ?? nil

      var closeButtonImage: NowChatConfiguration.CloseButtonType?
      if let buttonImage {
        closeButtonImage = .image(buttonImage)
      }
      let uiConfigurationWithImage = NowChatConfiguration.UIConfiguration(closeButton: closeButtonImage, attachmentUploadButton: attachmentUploadButton)         

      let chatConfiguration = NowChatConfiguration(uiConfiguration: uiConfigurationWithImage) 

      let result = chatService.makeChatUI(theme: CarrascoChatTheme(chatColors: ChatColors()), chatConfiguration: chatConfiguration)

      switch result { 
        case .success(let chatViewController):
          return chatViewController
        case .failure(let error):
          debugPrint("Chat screen creation failed with error: \(error)")
          return nil
      }
    }


