SuperwallDelegate
A protocol that handles Superwall lifecycle events and analytics.
Set the delegate using Superwall.shared.delegate = self
to receive these callbacks.
Use handleSuperwallEvent(withInfo:)
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 | oldValue , newValue | 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 Void
. 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:
How is this guide?