SuperwallDelegate
An interface that handles Superwall lifecycle events and analytics.
Set the delegate using Superwall.instance.delegate = this
to receive these callbacks. For Java, use setJavaDelegate()
for better Java interop.
Use handleSuperwallEvent(eventInfo)
to track Superwall analytics events in your own analytics platform for a complete view of user behavior.
Purpose
Provides callbacks for Superwall lifecycle events, analytics tracking, and custom paywall interactions.
Signature
Parameters
All methods are optional to implement. Key methods include:
Method | Parameters | Description |
---|---|---|
subscriptionStatusDidChange | from , to | Called when subscription status changes. |
handleSuperwallEvent | eventInfo | Called for all internal analytics events. Use for tracking in your own analytics. |
handleCustomPaywallAction | name | Called when user taps elements with data-pw-custom tags. |
willPresentPaywall | paywallInfo | Called before paywall presentation. |
didPresentPaywall | paywallInfo | Called after paywall presentation. |
willDismissPaywall | paywallInfo | Called before paywall dismissal. |
didDismissPaywall | paywallInfo | Called after paywall dismissal. |
Returns / State
All delegate methods return Unit
. They provide information about Superwall events and state changes.
Usage
Basic delegate setup:
Track subscription status changes:
Forward analytics events:
Handle custom paywall actions:
Handle paywall lifecycle:
Java usage:
How is this guide?