PurchaseControllerJava

The Kotlin-only interface that handles Superwall's subscription-related logic.

By default, the Superwall SDK handles all subscription-related logic. However, if you'd like more control, you can return a PurchaseControllerJava when configuring the SDK via Superwall.instance.configure(apiKey, purchaseController, options, completion).

When implementing this, you also need to set the subscription status using Superwall.instance.subscriptionStatus.

To learn how to implement the PurchaseControllerJava in your app and best practices, see Purchases and Subscription Status.

Functions

Link copied to clipboard
abstract fun purchase(productDetails: ProductDetails, basePlanId: String?, offerId: String?, completion: (PurchaseResult) -> Unit)

Called when the user initiates purchasing of a product.

Link copied to clipboard
abstract fun restorePurchases(completion: (RestorationResult, Throwable?) -> Unit)

Called when the user initiates a restore.