PaywallPresentationHandler
A handler class that provides status updates for paywall presentation in registerPlacement() calls.
Use this handler when you need fine-grained control over paywall events for a specific registerPlacement()
call, rather than global events via SuperwallDelegate
.
This handler is specific to the individual registerPlacement()
call. For global paywall events across your app, use SuperwallDelegate
instead.
Purpose
Provides callbacks for paywall lifecycle events when using registerPlacement()
with a specific handler instance.
Signature
Parameters
Method | Parameters | Description |
---|---|---|
onPresent | handler: (PaywallInfo) -> void | Sets a handler called when the paywall is presented. |
onDismiss | handler: (PaywallInfo, PaywallResult) -> void | Sets a handler called when the paywall is dismissed. |
onSkip | handler: (PaywallSkippedReason) -> void | Sets a handler called when paywall presentation is skipped. |
onError | handler: (String) -> void | Sets a handler called when an error occurs during presentation. |
Returns / State
Each method returns void
and configures the handler for the specific paywall lifecycle event.
Usage
Basic handler setup:
Handle skip and error cases:
Reusable handler class:
How is this guide?