SDK Reference
Reference for the Superwall Unity SDK beta C# API.
The Unity SDK exposes the Superwall namespace. Configure the SDK once with the static
Superwall.Configure(...) method, then use Superwall.Shared for placement registration, user
management, subscription state, and paywall utilities.
Superwall.Configure
public static Superwall Configure(
string apiKey,
SuperwallOptions options = null,
IPurchaseController purchaseController = null,
Action<ConfigurationResult> completion = null
)Prop
Type
RegisterPlacement
public void RegisterPlacement(
string placement,
Dictionary<string, object> parameters = null,
PaywallPresentationHandler handler = null,
Action feature = null
)Prop
Type
Common Methods and Properties
Prop
Type
Presentation Handler
public class PaywallPresentationHandler
{
public Action<PaywallInfo> OnPresent;
public Action<PaywallInfo, PaywallResult> OnDismiss;
public Action<string> OnError;
public Action<PaywallSkippedReason> OnSkip;
public Func<CustomCallback, Task<CustomCallbackResult>> OnCustomCallback;
}OnCustomCallback runs when the paywall requests a custom callback. Write it as an async lambda and return CustomCallbackResult.Success(data) or CustomCallbackResult.Failure(data). The paywall then runs its success or failure actions and can read data as callbacks.NAME.data.KEY. If the handler throws, is cancelled or returns null, the paywall gets a failure. On Android, custom callbacks need the default in-window presentation (AndroidPaywallPresentation.InWindow).
For a full walkthrough, see Custom Callbacks.
Related Guides
How is this guide?