Companion

object Companion

Properties

Link copied to clipboard
val billingError: StateFlow<PurchasesError>
Link copied to clipboard
val billingInfo: StateFlow<BillingInfo>
Link copied to clipboard

Functions

Link copied to clipboard

This function will be used to obtain all available products declared in RevenueCat. It is important that you have initialized the configuration from the function: Context.initPayment in your Application class.

Link copied to clipboard
fun isSubscriptionActive(onChecked: (Boolean, String) -> Unit = { _, _ -> })

Checks whether the user is subscribed or not.

Link copied to clipboard
fun purchase(context: Context, type: Payment.ProductsType, onSuccess: (Boolean, String) -> Unit = { _, _ -> }, onFailure: (PurchasesError, Boolean) -> Unit = { _, _ -> }): List<Package>?

This function is used to make a purchase request for our products/subscriptions. Remember that in addition to having the products/offers declared in RevenueCat, you must also have them included in the Store.

Link copied to clipboard
fun restorePurchases(onRestored: (Boolean, String) -> Unit = { _, _ -> })

Restoring purchases is a mechanism by which your user can restore their in-app purchases, reactivating any content that had previously been purchased from the same store account

Link copied to clipboard
Link copied to clipboard
fun upgradeDownGrade(context: Context, onSuccess: (Boolean, String) -> Unit = { _, _ -> }, onFailure: (PurchasesError, Boolean) -> Unit = { _, _ -> })

If a person is already a subscriber, you can upgrade the subscription status from Annual to Monthly, or from Monthly to Annual. However, cancellations can only be made through the Store.