AdaptyUIPaywallsEventsObserver

Observes lifecycle events and user interactions within an AdaptyUIPaywallView.

Implement this interface to handle paywall events such as appearing, disappearing, user actions, product selection, purchases, restores, rendering errors, and more.

The default implementation provides convenient behavior such as:

  • Automatically dismissing the paywall when the close button or system back button is pressed.

  • Automatically dismissing the paywall after a successful purchase.

You can override individual methods to customize paywall behavior in your app.

Example:

class MyPaywallObserver : AdaptyUIPaywallsEventsObserver {
override fun paywallViewDidFinishPurchase(
view: AdaptyUIPaywallView,
product: AdaptyPaywallProduct,
purchaseResult: AdaptyPurchaseResult
) {
// Custom logic after purchase
}
}

Properties

Link copied to clipboard
open val mainUiScope: CoroutineScope

The main CoroutineScope used for performing UI-related operations, such as dismissing the paywall view.

Functions

Link copied to clipboard

Called when the paywall view has been presented.

Link copied to clipboard

Called when the paywall view has been dismissed.

Link copied to clipboard

Called when an error occurs while loading products for the paywall.

Link copied to clipboard

Called when a purchase attempt fails.

Link copied to clipboard

Called when an error occurs while rendering the paywall UI.

Link copied to clipboard

Called when a restore operation fails.

Link copied to clipboard

Called when a purchase is successfully completed or canceled.

Link copied to clipboard

Called when a restore operation completes successfully.

Link copied to clipboard

Called when web payment navigation completes.

Link copied to clipboard

Called when a user performs an action on the paywall view.

Link copied to clipboard

Called when a product is selected for purchase, either by the user or automatically.

Link copied to clipboard

Called when the user initiates the purchase process.

Link copied to clipboard

Called when the user initiates a restore process.