Package-level declarations

Types

Link copied to clipboard

The result of a failed purchase operation. Used by suspending functions returning Either.

Functions

Link copied to clipboard
suspend fun <Error class: unknown class>.awaitCustomerInfoEither(fetchPolicy: <Error class: unknown class> = CacheFetchPolicy.default()): Either<<Error class: unknown class>, <Error class: unknown class>>

Get the latest available customer info.

Link copied to clipboard
suspend fun <Error class: unknown class>.awaitGetProductsEither(productIds: List<String>): Either<<Error class: unknown class>, List<<Error class: unknown class>>>

Gets the StoreProducts for the given list of product ids for all product types.

Link copied to clipboard
suspend fun <Error class: unknown class>.awaitLogInEither(newAppUserID: String): Either<<Error class: unknown class>, <Error class: unknown class>>

This function will change the current Purchases.appUserID. Typically this would be used after a log out to identify a new user without calling Purchases.configure.

Link copied to clipboard
suspend fun <Error class: unknown class>.awaitLogOutEither(): Either<<Error class: unknown class>, <Error class: unknown class>>

Resets the Purchases client clearing the save Purchases.appUserID. This will generate a random user id and save it in the cache.

Link copied to clipboard
suspend fun <Error class: unknown class>.awaitOfferingsEither(): Either<<Error class: unknown class>, <Error class: unknown class>>

Fetch the configured offerings for this users. Offerings allows you to configure your in-app products vis RevenueCat and greatly simplifies management. See the guide for more info.

Link copied to clipboard
suspend fun <Error class: unknown class>.awaitPromotionalOfferEither(discount: <Error class: unknown class>, storeProduct: <Error class: unknown class>): Either<<Error class: unknown class>, <Error class: unknown class>>

App Store only. Use this method to fetch a PromotionalOffer to use with awaitPurchase.

Link copied to clipboard
suspend fun <Error class: unknown class>.awaitPurchaseEither(packageToPurchase: <Error class: unknown class>, promotionalOffer: <Error class: unknown class>): Either<FailedPurchase, <Error class: unknown class>>

App Store only. Purchases packageToPurchase. Call this method when a user has decided to purchase a product with an applied discount. Only call this in direct response to user input. From here Purchases will handle the purchase with StoreKit.

suspend fun <Error class: unknown class>.awaitPurchaseEither(storeProduct: <Error class: unknown class>, promotionalOffer: <Error class: unknown class>): Either<FailedPurchase, <Error class: unknown class>>

App Store only. Use this function if you are not using the Offerings system to purchase a StoreProduct with an applied PromotionalOffer. If you are using the Offerings system, use the overload with a Package parameter instead.

suspend fun <Error class: unknown class>.awaitPurchaseEither(packageToPurchase: <Error class: unknown class>, isPersonalizedPrice: Boolean? = null, oldProductId: String? = null, replacementMode: <Error class: unknown class> = GoogleReplacementMode.WITHOUT_PRORATION): Either<FailedPurchase, <Error class: unknown class>>

Purchases packageToPurchase. On the Play Store, if packageToPurchase represents a subscription, upgrades from the subscription specified by oldProductId and chooses the default SubscriptionOption from packageToPurchase.

suspend fun <Error class: unknown class>.awaitPurchaseEither(storeProduct: <Error class: unknown class>, isPersonalizedPrice: Boolean? = null, oldProductId: String? = null, replacementMode: <Error class: unknown class> = GoogleReplacementMode.WITHOUT_PRORATION): Either<FailedPurchase, <Error class: unknown class>>

Purchases storeProduct. On the Play Store, if storeProduct represents a subscription, upgrades from the subscription specified by oldProductId and chooses storeProduct's default SubscriptionOption.

suspend fun <Error class: unknown class>.awaitPurchaseEither(subscriptionOption: <Error class: unknown class>, isPersonalizedPrice: Boolean? = null, oldProductId: String? = null, replacementMode: <Error class: unknown class> = GoogleReplacementMode.WITHOUT_PRORATION): Either<FailedPurchase, <Error class: unknown class>>

Play Store only. Purchases subscriptionOption.

Link copied to clipboard
suspend fun <Error class: unknown class>.awaitRestoreEither(): Either<<Error class: unknown class>, <Error class: unknown class>>

Restores purchases made with the current Store account for the current user. This method will post all purchases associated with the current Store account to RevenueCat and become associated with the current Purchases.appUserID. If the receipt token is being used by an existing user, the current Purchases.appUserID will be aliased together with the Purchases.appUserID of the existing user. Going forward, either Purchases.appUserID will be able to reference the same user.

suspend fun <Error class: unknown class>.awaitSyncAttributesAndOfferingsIfNeededEither(): Either<<Error class: unknown class>, <Error class: unknown class>>

Syncs subscriber attributes and then fetches the configured offerings for this user. This method is intended to be called when using Targeting Rules with Custom Attributes. Any subscriber attributes should be set before calling this method to ensure the returned offerings are applied with the latest subscriber attributes.

Link copied to clipboard
suspend fun <Error class: unknown class>.awaitSyncPurchasesEither(): Either<<Error class: unknown class>, <Error class: unknown class>>

This method will send all the purchases to the RevenueCat backend. Call this when using your own implementation for subscriptions anytime a sync is needed, such as when migrating existing users to RevenueCat.