performPurchaseWithCompletion
abstract fun performPurchaseWithCompletion(activity: Activity, rcPackage: Package, completion: (PurchaseLogicResult) -> Unit)
Performs an in-app purchase for the specified package with a completion callback.
If a purchase is successful, syncPurchases
will automatically be called by RevenueCat to update our database. However, if you are using Amazon's store, you must call syncAmazonPurchase
in your code.
Parameters
activity
The current Android Activity
triggering the purchase.
rcPackage
The package representing the in-app product that the user intends to purchase.
completion
A callback function that receives a PurchaseLogicResult
object containing the outcome of the purchase operation.