NowChatSDK class - Android
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.
NowChatSDK - makeChatService(instanceURL: URL, nowChatSdkCallbacks)
Creates a NowChat service. This is a suspend function.
| Name | Type | Description |
|---|---|---|
| instanceURL | URL | URL of the ServiceNow instance that the NowChatService should interact with. |
| nowChatSdkCallbacks | NowChatSdkCallbacks | Callbacks for the host application to use to configure the NowChatService. |
| Type | Description |
|---|---|
| None |
@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")
}
}