Advanced
getPaywall()
A function that retrieves a PaywallViewController for custom presentation.
You're responsible for the deallocation of the returned PaywallViewController. Do not present the same PaywallViewController in multiple places simultaneously.
The remotely configured presentation style is ignored when using this method. You must handle presentation styling programmatically.
Purpose
Retrieves a PaywallViewController that you can present however you want, bypassing Superwall's automatic presentation logic.
Signature
Parameters
Name | Type | Description |
---|---|---|
placement | String | The name of the placement as defined on the Superwall dashboard. |
params | [String: Any]? | Optional parameters to pass with your placement for audience filters. Keys beginning with $ are reserved and will be dropped. Defaults to nil . |
paywallOverrides | PaywallOverrides? | Optional overrides for products and presentation style. Defaults to nil . |
delegate | PaywallViewControllerDelegate | A delegate to handle user interactions with the retrieved PaywallViewController. |
completion | @escaping (PaywallViewController?, PaywallSkippedReason?, Error?) -> Void | Completion block for the callback version. |
Returns / State
Returns a PaywallViewController
that you can present. If presentation should be skipped, throws a PaywallSkippedReason
error.
Usage
Using async/await:
Using completion handler:
How is this guide?