> ## Documentation Index
> Fetch the complete documentation index at: https://asapp-04-04-getting-started-ga.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Deep Links and Web Links

## Handling Deep Links in Chat

Certain chat flows may present buttons that are deep links to another part of your app. To react to taps on these buttons, implement the `ASAPPDeepLinkHandler` interface:

```kotlin
ASAPP.instance.deepLinkHandler = object : ASAPPDeepLinkHandler {
    override fun handleASAPPDeepLink(deepLink: String, data: JSONObject?, activity: Activity) {
        // Handle deep link.
    }
} 
```

ASAPP provides an `Activity` instance for convenience, in case you need to start a new activity. Please ask your Implementation Manager if you have questions regarding deep link names and data.

## Handling Web Links in Chat

Certain chat flows may present buttons that are web links. To react to taps on these buttons, implement the `ASAPPWebLinkHandler` interface:

```kotlin
ASAPP.instance.webLinkHandler = object : ASAPPWebLinkHandler {
    override fun handleASAPPWebLink(webLink: String, activity: Activity) {
        // Handle web link.
    }
}
```

<Note>
  If you don't implement the handler (see above), the ASAPP SDK will open the link utilizing the system default with `Intent.ACTION_VIEW`.
</Note>

## Implementing Deep Links into Chat

### Getting Started

Please see the Android documentation on [Handling Android App Links](https://developer.android.com/training/app-links).

### Connecting the Pieces

Once you set up a custom URL scheme for your app and handle deep links into your application, you can start chat to pass any data payload extracted from the link:

```json
ASAPP.instance.openChat(context, asappIntent= mapOf("Code": "EXAMPLE_INTENT"))
```
