---
schema_version: "1"
id: 0ee32a4991ac55a29d4ee69f016b9299c436daef5b6930db163dc8d879c566a5
title: Auto-Response Component for Android
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/messaging-in-app/guides/android-auto-response.md
canonical_url: https://developer.salesforce.com/docs/service/messaging-in-app/guide/android-auto-response.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e678e1adde848d914fcd133049fa7c4503868eb238047fb9afc6996be5a6a7a5
products:
  - Enhanced In-App Chat
  - Service Cloud Developer Content
---
# Auto-Response Component for Android

Send customers structured content (such as survey links) with Messaging auto-response components.


**important:** This feature requires version 1.2.0 or later of the Enhanced In-App Chat SDK.


This article applies to the following implementations:

| UI SDK | Core SDK |
| :----: | :------: |
|   ✅   |    ✅    |


An auto-response is a text or link response sent when a customer initiates a messaging session, a rep joins, or a session ends. This topic describes how to send parameters to Salesforce for the auto-response Messaging component. You can use this component during or after the conversation to show the user a web page, such as a survey. To learn about and set up auto-response components, see [Create a Messaging Component: Auto-Response](https://help.salesforce.com/s/articleView?id=service.messaging_components_auto_response.htm).

**note:** The Enhanced In-App Chat UI SDK automatically displays any auto-response components that you add in Salesforce. You don't write any code to display this component. If you're using the Core SDK, you can process the incoming `ConversationEntry` object as you would any other incoming message. This documentation shows you how to optionally pass additional parameters to the URL that is presented to the user.

After you've set up the auto-response component in Salesforce, you can optionally send additional parameters from the app using the SDK. These parameters are mapped to the path and the query string of the auto-response URL.


1. Implement the [`TemplatedUrlValuesProvider`](https://salesforce-async-messaging.github.io/messaging-in-app-android/sdk/core/com.salesforce.android.smi.core/-templated-url-values-provider/index.html) interface. This provider contains the `setValues` method, which the SDK calls to set parameter values.
2. Add your provider to the SDK using the `CoreClient.registerTemplatedUrlValuesProvider` property. See the [`CoreClient`](https://salesforce-async-messaging.github.io/messaging-in-app-android/sdk/core/com.salesforce.android.smi.core/-core-client/index.html) reference documentation.

**note:** This sample code requires the configuration object that you created when setting up the UI SDK or the Core SDK. See [Build a UI SDK App](https://developer.salesforce.com/docs/service/messaging-in-app/guide/android-ui-sdk.md) or [Build a Core SDK App](https://developer.salesforce.com/docs/service/messaging-in-app/guide/android-core-sdk.md) for more information.

```kotlin
// Create a core client from a config
val coreClient = CoreClient.Factory.create(myContext, config)

// Register a provider
coreClient.registerTemplatedUrlValuesProvider( object : TemplatedUrlValuesProvider {

  // Implement the setValues method
  override suspend fun setValues(input: TemplatedWebView): TemplatedWebView {

    // Iterate through all the path parameter fields
    input.pathParams.forEach {

      // Inspect key value using it.key
      // If we want to specify a value, then use the setPathParameterValue method
      input.setPathParameterValue(it.key, "My path parameter value")
    }

    // Iterate through all the query parameter fields
    input.queryParams.forEach {

      // Inspect key value using it.key
      // If we want to specify a value, then use the setQueryParameterValue method
      input.setQueryParameterValue(it.key, "My query parameter value")
    }

    // Return the same list, but with values set
    return input
  }
})
```

After you register your provider, the SDK automatically calls the `setValues` method before an auto-response Messaging component is shown.
