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

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# NowChatSDK class - Android

# NowChatSDK class - Android {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

The NowChatService class provides the function necessary to create a
NowChatService that interacts with NowChat. NowChat provides the ability to embed Live Agent and Virtual Agent within your application.
For additional information on Live Agent and Virtual Agent, see [Virtual Agent](https://www.servicenow.com/docs/access?context=virtual-agent-landing-page&version=xanadu&pubname=xanadu-conversational-interfaces&ft:locale=en-US).

## NowChatSDK - makeChatService(instanceURL: URL, nowChatSdkCallbacks) {#ariaid-title2}

Creates a NowChat service. This is a suspend function.
{#NChatSDK-makeChatService_S_S_S_S__table_nvq_fzc_npb__entry__3}

| Name | Type | Description |
|-|-|-|
| instanceURL | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | URL of the ServiceNow instance that the NowChatService should interact with. |
| nowChatSdkCallbacks | [NowChatSdkCallbacks](https://servicenow-prod.fluidtopics.net/Hdy42BPsV0hfwZmk2IK7TA#NowChatSdkCallbacksAndroidInt "The NowChatSdkCallbacks interface provides functions that enable callbacks for host applications to configure or handle actions from the NowChatSDK.") | Callbacks for the host application to use to configure the NowChatService. |
[Table 1. Parameters]

{#NChatSDK-makeChatService_S_S_S_S__table_nvq_fzc_npb} {#NChatSDK-makeChatService_S_S_S_S__table_ovq_fzc_npb__entry__2}

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

{#NChatSDK-makeChatService_S_S_S_S__table_ovq_fzc_npb}  

    @Inject lateinit var sdkSettingsProvider: Provider<NowSDKSettings>
    @Inject lateinit var chatCallbacks: SampleAppNowChatSDKCallbacks

    private fun launchChat() {
      binding.progressBar.visibility = View.VISIBLE

      NowChatSDK.makeChatService(
        URL(sdkSettingsProvider.get().instanceBaseURL),
        chatCallbacks
      ) .onSuccess {
        it.start(this, chatCallbacks.nowChatThemeColors) }
      } .onFailure {
         Log.e("NowChat", "Unable to launch chat: $it")
      }
    }


