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:

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.

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

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

If you don’t implement the handler (see above), the ASAPP SDK will open the link utilizing the system default with Intent.ACTION_VIEW.

Getting Started

Please see the Android documentation on Handling Android 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:

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