purchase

open suspend override fun purchase(activity: Activity, productDetails: ProductDetails, basePlanId: String?, offerId: String?): PurchaseResult(source)

Called when the user initiates purchasing of a product.

Add your purchase logic here and return its result. You can use Android's Billing APIs, or if you use RevenueCat, you can call Purchases.shared.purchase(product).

Return

A PurchaseResult object, which is the result of your purchase logic. Note: Make sure you handle all cases of PurchaseResult.

Parameters

productDefaults

The ProductDetails the user would like to purchase.

basePlanId

An optional base plan identifier of the product that's being purchased.

offerId

An optional offer identifier of the product that's being purchased.