-
public interface PurchaseLogicInterface for handling in-app purchases and restorations directly by the application rather than by RevenueCat. These suspend methods are called by a RevenueCat Paywall in order to execute you app's custom purchase/restore code. These functions are only called when
Purchases.purchasesAreCompletedByis set toMY_APP.If you prefer to implement custom purchase and restore logic with completion handlers, please implement
PurchaseLogicWithCallback.
-
-
Method Summary
Modifier and Type Method Description abstract PurchaseLogicResultperformPurchase(Activity activity, Package rcPackage)Performs an in-app purchase for the specified package. abstract PurchaseLogicResultperformRestore(CustomerInfo customerInfo)Restores previously completed purchases for the given customer. -
-
Method Detail
-
performPurchase
abstract PurchaseLogicResult performPurchase(Activity activity, Package rcPackage)
Performs an in-app purchase for the specified package.
If a purchase is successful,
syncPurchaseswill automatically be called by RevenueCat to update our database. However, if you are using Amazon's store, you must callsyncAmazonPurchasein your code.- Parameters:
activity- The current AndroidActivitytriggering the purchase.rcPackage- The package representing the in-app product that the user intends to purchase.
-
performRestore
abstract PurchaseLogicResult performRestore(CustomerInfo customerInfo)
Restores previously completed purchases for the given customer.
If restoration is successful,
syncPurchaseswill automatically be called by RevenueCat to update our database. However, if you are using Amazon's store, you must callsyncAmazonPurchasein your code.- Parameters:
customerInfo- An object containing information about the customer.
-
-
-
-