PurchaseLogicWithCallback

Abstract class extending PurchaseLogic, providing methods for handling in-app purchases and restorations with completion callbacks rather than co-routines.

If you prefer to implement custom purchase and restore logic with coroutines, please implement PurchaseLogic directly.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
suspend override fun performPurchase(activity: Activity, rcPackage: Package): PurchaseLogicResult

This method is called by RevenueCat, which in turn calls performPurchaseWithCompletion where your app's custom purchase logic is performed.

Link copied to clipboard
abstract fun performPurchaseWithCompletion(activity: Activity, rcPackage: Package, completion: (PurchaseLogicResult) -> Unit)

Performs an in-app purchase for the specified package with a completion callback.

Link copied to clipboard
suspend override fun performRestore(customerInfo: CustomerInfo): PurchaseLogicResult

This method is called by RevenueCat, which in turn calls performRestoreWithCompletion where your app's custom purchase logic is performed.

Link copied to clipboard
abstract fun performRestoreWithCompletion(customerInfo: CustomerInfo, completion: (PurchaseLogicResult) -> Unit)

Restores previously completed purchases for the given customer with a completion callback.