configure()
A static function that configures a shared instance of Superwall for use throughout your app.
This is a static method called on the Superwall
class itself, not on the shared instance.
Purpose
Configures the shared instance of Superwall with your API key and optional configurations, making it ready for use throughout your app.
Signature
Parameters
Name | Type | Description |
---|---|---|
apiKey | String | Your Public API Key from the Superwall dashboard settings. |
purchaseController | PurchaseController? | Optional object for handling all subscription-related logic yourself. If nil , Superwall handles subscription logic. Defaults to nil . |
options | SuperwallOptions? | Optional configuration object for customizing paywall appearance and behavior. See SuperwallOptions for details. Defaults to nil . |
completion | (() -> Void)? | Optional completion handler called when Superwall finishes configuring. Defaults to nil . |
Returns / State
Returns the configured Superwall
instance. The instance is also accessible via Superwall.shared
.
Usage
Basic configuration:
With custom options:
With custom purchase controller:
How is this guide?