Enum of different possible states for intro price eligibility status.
Enumeration of all possible Package types.
Replace SKU's ProrationMode.
Enum of all error codes the SDK produces.
Supported SKU types.
Sets a function to be called on updated customer info
CustomerInfo update listener
Sets a function to be called on purchases initiated on the Apple App Store. This is only used in iOS.
Called when a user initiates a promotional in-app purchase from the App Store. If your app is able to handle a purchase at the current time, run the deferredPurchase function. If the app is not in a state to make a purchase: cache the deferredPurchase, then call the deferredPurchase when the app is ready to make the promotional purchase. If the purchase should never be made, you don't need to ever call the deferredPurchase and the app will not proceed with promotional purchases.
Check if billing is supported for the current user (meaning IN-APP purchases are supported) and optionally, whether a list of specified feature types are supported.
Note: Billing features are only relevant to Google Play Android users. For other stores and platforms, billing features won't be checked.
An array of feature types to check for support. Feature types must be one of [BILLING_FEATURE]. By default, is an empty list and no specific feature support will be checked.
promise with boolean response. True if billing is supported, false otherwise.
iOS only. Computes whether or not a user is eligible for the introductory pricing period of a given product. You should use this method to determine whether or not you show the user the normal product price or the introductory price. This also applies to trials (trials are considered a type of introductory pricing).
Array of product identifiers for which you want to compute eligibility
A map of IntroEligility per productId. The promise will be rejected if configure has not been called yet or if there's in an error checking eligibility.
Automatically collect subscriber attributes associated with the device identifiers. $idfa, $idfv, $ip on iOS $gpsAdId, $androidId, $ip on Android
The promise will be rejected if configure has not been called yet or if there's an error setting collecting the device identifiers.
Sets up Purchases with your API key and an app user id.
Enable automatic collection of Apple Search Ad attribution on iOS. Disabled by default
The promise will be rejected if configure has not been called yet.
Get the appUserID
The app user id in a promise
Gets current customer info
A promise of a customer info object. Rejections return an error code, and an userInfo object with more information. The promise will be rejected if configure has not been called yet or if there's an issue getting the customer information.
Gets the map of entitlements -> offerings -> products
Promise of entitlements structure. The promise will be rejected if configure has not been called yet.
Fetch the product info
Array of product identifiers
Optional type of products to fetch, can be inapp or subs. Subs by default
A promise containing an array of products. The promise will be rejected if the products are not properly configured in RevenueCat or if there is another error retrieving them. Rejections return an error code, and a userInfo object with more information. The promise will also be rejected if configure has not been called yet.
iOS only. Use this function to retrieve the PurchasesPromotionalOffer
for a given PurchasesPackage
.
The PurchasesStoreProduct
the user intends to purchase.
The PurchasesStoreProductDiscount
to apply to the product.
Returns when the PurchasesPaymentDiscount
is returned.
Null is returned for Android and incompatible iOS versions. The promise will be rejected if configure has not been
called yet or if there's an error getting the payment discount.
Invalidates the cache for customer information.
Most apps will not need to use this method; invalidating the cache can leave your app in an invalid state. Refer to https://docs.revenuecat.com/docs/customer-info#section-get-user-information for more information on using the cache properly.
This is useful for cases where customer information might have been updated outside of the app, like if a promotional subscription is granted through the RevenueCat dashboard.
The promise will be rejected if configure has not been called yet or there's an error invalidating the customer info cache.
If the appUserID
has been generated by RevenueCat or not.
Check if configure has finished and Purchases has been configured.
promise with boolean response
This function will logIn the current user with an appUserID. Typically this would be used after a log in to identify a user without calling configure.
The appUserID that should be linked to the currently user
A promise of an object that contains the customerInfo after logging in, as well as a boolean indicating whether the user has just been created for the first time in the RevenueCat backend. The promise will be rejected if configure has not been called yet or if there's an issue logging in.
Logs out the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache.
A promise of a customer info object. Rejections return an error code, and a userInfo object with more information. The promise will be rejected if configure has not been called yet or if there's an issue logging out.
iOS only. Presents a code redemption sheet, useful for redeeming offer codes Refer to https://docs.revenuecat.com/docs/ios-subscription-offers#offer-codes for more information on how to configure and use offer codes
The promise will be rejected if configure has not been called yet or there's an error presenting the code redemption sheet.
iOS only. Purchase a package applying a given discount.
The Package you wish to purchase. You can get the Packages by calling getOfferings
Discount to apply to this package. Retrieve this discount using getPromotionalOffer.
} A promise of an object containing a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure has not been called yet.
iOS only. Purchase a product applying a given discount.
The product you want to purchase
Discount to apply to this package. Retrieve this discount using getPromotionalOffer.
} A promise of an object containing a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will be rejected if configure has not been called yet.
Make a purchase
The Package you wish to purchase. You can get the Packages by calling getOfferings
Android only. Optional UpgradeInfo you wish to upgrade from containing the oldSKU and the optional prorationMode.
} A promise of an object containing a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure has not been called yet.
Make a purchase
The product identifier of the product you want to purchase
Android only. Optional UpgradeInfo you wish to upgrade from containing the oldSKU and the optional prorationMode.
Optional type of product, can be inapp or subs. Subs by default
} A promise of an object containing a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will also be rejected if configure has not been called yet.
Removes a given CustomerInfoUpdateListener
CustomerInfoUpdateListener reference of the listener to remove
True if listener was removed, false otherwise
Removes a given ShouldPurchasePromoProductListener
ShouldPurchasePromoProductListener reference of the listener to remove
True if listener was removed, false otherwise
Restores a user's previous purchases and links their appUserIDs to any user's also using those purchases.
A promise of a customer info object. Rejections return an error code, and an userInfo object with more information. The promise will be also be rejected if configure has not been called yet.
Subscriber attribute associated with the install ad for the user
Empty String or null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting the ad subscriber attribute.
Subscriber attribute associated with the install ad group for the user
Empty String or null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting ad group.
Subscriber attribute associated with the Adjust Id for the user Required for the RevenueCat Adjust integration
Empty String or null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting Adjust ID.
Subscriber attribute associated with the Airship Channel Id for the user Required for the RevenueCat Airship integration
Empty String or null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting the Airship Channel ID.
Set this to true if you are passing in an appUserID but it is anonymous, this is true by default if you didn't pass an appUserID
The promise will be rejected if configure has not been called yet.
Subscriber attribute associated with the AppsFlyer Id for the user Required for the RevenueCat AppsFlyer integration
Empty String or null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting the Appsflyer ID.
Subscriber attributes are useful for storing additional, structured information on a user. Since attributes are writable using a public key they should not be used for managing secure or sensitive information such as subscription status, coins, etc.
Key names starting with "$" are reserved names used by RevenueCat. For a full list of key restrictions refer to our guide: https://docs.revenuecat.com/docs/subscriber-attributes
Map of attributes by key. Set the value as an empty string to delete an attribute.
The promise will be rejected if configure has not been called yet or there's an error setting the subscriber attributes.
Enable or not automatic apple search ads attribution collection
The promise will be rejected if configure has not been called yet.
Subscriber attribute associated with the install campaign for the user
Empty String or null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting the campaign.
Subscriber attribute associated with the install ad creative for the user
Empty String or null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting the creative subscriber attribute.
Enables/Disables debugs logs
Enable or not debug logs
Subscriber attribute associated with the display name for the user
Empty String or null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting the display name.
Subscriber attribute associated with the email address for the user
Empty String or null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting the email.
Subscriber attribute associated with the Facebook SDK Anonymous Id for the user Recommended for the RevenueCat Facebook integration
Empty String or null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting the Facebook Anonymous ID.
Set finishTransactions to false if you aren't using Purchases SDK to make the purchase
The promise will be rejected if configure has not been called yet.
Subscriber attribute associated with the install keyword for the user
Empty String or null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting the keyword.
Subscriber attribute associated with the install media source for the user
Empty String or null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting the media source.
Subscriber attribute associated with the mParticle Id for the user Recommended for the RevenueCat mParticle integration
Empty String or null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting the Mparticle ID.
Subscriber attribute associated with the OneSignal Player Id for the user Required for the RevenueCat OneSignal integration
Empty String or null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting the Onesignal ID.
Subscriber attribute associated with the phone number for the user
Empty String or null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting the phone number.
Set this property to your proxy URL before configuring Purchases only if you've received a proxy key value from your RevenueCat contact.
The promise will be rejected if configure has not been called yet or if there's an error setting the proxy url.
Subscriber attribute associated with the push token for the user
null will delete the subscriber attribute.
The promise will be rejected if configure has not been called yet or if there's an error setting the push token.
iOS only.
Set this property to true only when testing the ask-to-buy / SCA purchases flow. More information: http://errors.rev.cat/ask-to-buy
The promise will be rejected if configure has not been called yet.
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, like after a successful purchase.
The promise will be rejected if configure has not been called yet or if there's an error syncing purchases.
Generated using TypeDoc
Enum for billing features. Currently, these are only relevant for Google Play Android users: https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType