# EngagementSignalsCallback

Artifact: [androidx.browser:browser](https://developer.android.com/jetpack/androidx/releases/browser) [View Source](https://cs.android.com/search?q=file:androidx/browser/customtabs/EngagementSignalsCallback.java+class:androidx.browser.customtabs.EngagementSignalsCallback) Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/browser#1.6.0)

*** ** * ** ***


```
interface EngagementSignalsCallback
```

<br />

*** ** * ** ***

A callback class for custom tabs clients to get messages regarding the user's engagement with the webpage within their custom tabs. These methods may not be called for some webpages. In the implementation, all callbacks are sent to the Executor provided by the client or its UI thread if one is not provided.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/EngagementSignalsCallback#onGreatestScrollPercentageIncreased(int,android.os.Bundle)( scrollPercentage: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1, to = 100) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, extras: https://developer.android.com/reference/android/os/Bundle.html )` Called when a user has reached a greater scroll percentage on the page. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/EngagementSignalsCallback#onSessionEnded(boolean,android.os.Bundle)(didUserInteract: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, extras: https://developer.android.com/reference/android/os/Bundle.html)` Called when a `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsSession` is ending or when no further Engagement Signals callbacks are expected to report whether any user action has occurred during the session. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/EngagementSignalsCallback#onVerticalScrollEvent(boolean,android.os.Bundle)(isDirectionUp: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, extras: https://developer.android.com/reference/android/os/Bundle.html)` Called when a user scrolls the tab. |

## Public functions

### onGreatestScrollPercentageIncreased

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/browser#1.6.0)

```
fun onGreatestScrollPercentageIncreased(
    scrollPercentage: @IntRange(from = 1, to = 100) Int,
    extras: Bundle
): Unit
```

Called when a user has reached a greater scroll percentage on the page. The greatest scroll percentage is reset if the user navigates to a different page. If the current page's total height changes, this method will be called again only if the scroll progress reaches a higher percentage based on the new and current height of the page.

| Parameters |
|---|---|
| `scrollPercentage: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1, to = 100) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | An integer indicating the percent of scrollable progress the user has made down the current page. |
| `extras: https://developer.android.com/reference/android/os/Bundle.html` | Reserved for future use. |

### onSessionEnded

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/browser#1.6.0)

```
fun onSessionEnded(didUserInteract: Boolean, extras: Bundle): Unit
```

Called when a `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsSession` is ending or when no further Engagement Signals callbacks are expected to report whether any user action has occurred during the session.

| Parameters |
|---|---|
| `didUserInteract: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the user has interacted with the page in any way, e.g. scrolling. |
| `extras: https://developer.android.com/reference/android/os/Bundle.html` | Reserved for future use. |

### onVerticalScrollEvent

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/browser#1.6.0)

```
fun onVerticalScrollEvent(isDirectionUp: Boolean, extras: Bundle): Unit
```

Called when a user scrolls the tab.

| Parameters |
|---|---|
| `isDirectionUp: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | False when the user scrolls farther down the page, and true when the user scrolls back up toward the top of the page. |
| `extras: https://developer.android.com/reference/android/os/Bundle.html` | Reserved for future use. |