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
Enum of different possible states for intro price eligibility status.
Enum of different possible in-app message types.
Enum of different possible log levels.
Enumeration of all possible Package types.
Supported product categories.
Replace SKU's ProrationMode.
Modes for completing the purchase process.
Supported SKU types.
Enum with possible return states for beginning refund request.
Defines which version of StoreKit may be used.
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.
iOS 15+ only. Presents a refund request sheet in the current window scene for the latest transaction associated with the active entitlement.
If the request was unsuccessful, no active entitlements could be found for
the user, or multiple active entitlements were found for the user,
the promise will return an error.
If called in an unsupported platform (iOS < 15), an unsupportedError
will be sent to the callback.
Important: This method should only be used if your user can only have a single active entitlement at a given time.
If a user could have more than one entitlement at a time, use beginRefundRequestForEntitlement
instead.
REFUND_REQUEST_STATUS: The status of the refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED
Callback triggered after an error when beginning refund request for active entitlement.
iOS 15+ only. Presents a refund request sheet in the current window scene for
the latest transaction associated with the entitlement
.
If the request was unsuccessful, the promise will return an error.
If called in an unsupported platform (iOS < 15), an unsupportedError
will be sent to the callback.
The entitlement to begin a refund request for.
REFUND_REQUEST_STATUS: The status of the refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED
Callback triggered after an error when beginning refund request for an entitlement.
iOS 15+ only. Presents a refund request sheet in the current window scene for
the latest transaction associated with the product
.
If the request was unsuccessful, the promise will return an error.
If called in an unsupported platform (iOS < 15), an unsupportedError
will be sent to the callback.
The StoreProduct to begin a refund request for.
REFUND_REQUEST_STATUS: The status of the refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED
Callback triggered after an error when beginning refund request for a product.
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.
Will be sent true if billing is supported, false otherwise.
Callback triggered after an error or when checking if billing is supported.
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
Will be sent a map of IntroEligibility per productId
Automatically collect subscriber attributes associated with the device identifiers. $idfa, $idfv, $ip on iOS $gpsAdId, $androidId, $ip on Android
RevenueCat API Key. Needs to be a string
A unique id for identifying the user
An optional string. iOS-only, will be ignored for Android. Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults suite, otherwise it will use standardUserDefaults. Default is null, which will make the SDK use standardUserDefaults.
Sets up Purchases with your API key and an app user id.
Enable automatic collection of Apple Search Ads attribution using AdServices. Disabled by default.
Get the appUserID that is currently in placed in the SDK
Callback that will receive the current appUserID
Gets the current customer info. This call will return the cached customer info unless the cache is stale, in which case, it will make a network call to retrieve it from the servers.
Callback that will receive the customer info
Callback that will be triggered whenever there is any problem retrieving the customer info
Gets the Offerings configured in the RevenueCat dashboard
Callback triggered after a successful getOfferings call.
Callback triggered after an error or when retrieving offerings.
Fetch the product info
Array of product identifiers
Callback triggered after a successful getProducts call. It will receive an array of product objects.
Callback triggered after an error or when retrieving products
Optional type of products to fetch, can be inapp or subs. Subs by default
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.
Will be sent a boolean indicating if the appUserID
has been generated
by RevenueCat or not.
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
Callback that will receive 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.
Callback that will be triggered whenever there is any problem logging in.
Logs out the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache. If the current user is already anonymous, this will produce a PurchasesError.
Callback that will receive the new customer info after resetting
Callback that will be triggered whenever there is an error when logging out. This could happen for example if logOut is called but the current user is anonymous.
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.
Make a purchase
The Package you wish to purchase. You can get the Packages by calling getOfferings
Callback triggered after a successful purchase.
Callback triggered after an error or when the user cancels the purchase. If user cancelled, userCancelled will be true
Android only. Optional UpgradeInfo you wish to upgrade from containing the oldSKU and the optional prorationMode.
Android only. Optional GoogleProductChangeInfo you
Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU. For compliance with EU regulations. User will see "This price has been customized for you" in the purchase dialog when true. See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.
Make a purchase
The product identifier of the product you want to purchase.
Callback triggered after a successful purchase.
Callback triggered after an error or when the user cancels the purchase. If user cancelled, userCancelled will be true
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
Make a purchase
The product you want to purchase
Callback triggered after a successful purchase.
Callback triggered after an error or when the user cancels the purchase If user cancelled, userCancelled will be true
Android only. Optional GoogleProductChangeInfo you wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.
Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU. For compliance with EU regulations. User will see "This price has been customized for you" in the purchase dialog when true. See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.
Google only. Make a purchase of a subscriptionOption
The SubscriptionOption you wish to purchase. You can get the SubscriptionOption from StoreProducts by calling getOfferings
Callback triggered after a successful purchase.
Callback triggered after an error or when the user cancels the purchase. If user cancelled, userCancelled will be true
Android only. Optional GoogleProductChangeInfo you wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.
Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU. For compliance with EU regulations. User will see "This price has been customized for you" in the purchase dialog when true. See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.
iOS only. Always returns an error on iOS < 15.
Use this method only if you already have your own IAP implementation using StoreKit 2 and want to use RevenueCat's backend. If you are using StoreKit 1 for your implementation, you do not need this method.
You only need to use this method with new purchases. Subscription updates are observed automatically.
Important: This should only be used if you have set PurchasesAreCompletedBy to MY_APP during SDK configuration.
Product ID that was just purchased
If there was a transacton found and handled for the provided product ID.
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.
Callback that will receive the new customer info after restoring transactions.
Callback that will be triggered whenever there is any problem restoring the user transactions. This gets normally triggered if there is an error retrieving the new customer info for the new user or the user cancelled the restore
Subscriber attribute associated with the install ad for the user
Empty String or null will delete the subscriber attribute.
Subscriber attribute associated with the install ad group for the user
Empty String or null will delete the subscriber attribute.
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.
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.
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.
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.
Subscriber attribute associated with the install campaign for the user
Empty String or null will delete the subscriber attribute.
Subscriber attribute associated with the CleverTap ID for the user Required for the RevenueCat CleverTap integration
Empty String or null will delete the subscriber attribute.
Subscriber attribute associated with the install ad creative for the user
Empty String or null will delete the subscriber attribute.
Enables/Disables debugs logs
Enable or disable debug logs
Subscriber attribute associated with the display name for the user
Empty String or null will delete the subscriber attribute.
Subscriber attribute associated with the email address for the user
Empty String or null will delete the subscriber attribute.
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.
Subscriber attribute associated with the Firebase App Instance ID for the user Required for the RevenueCat Firebase integration
Empty String or null will delete the subscriber attribute.
Subscriber attribute associated with the install keyword for the user
Empty String or null will delete the subscriber attribute.
Set a custom log handler for redirecting logs to your own logging system. By default, this sends info, warning, and error messages. If you wish to receive Debug level messages, see [setLogLevel].
It will get called for each log event. Use this function to redirect the log to your own logging system
Used to set the log level. Useful for debugging issues with the lovely team @RevenueCat.
the minimum log level to enable.
Subscriber attribute associated with the install media source for the user
Empty String or null will delete the subscriber attribute.
Subscriber attribute associated with the Mixpanel Distinct ID for the user Required for the RevenueCat Mixpanel integration
Empty String or null will delete the subscriber attribute.
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.
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.
Subscriber attribute associated with the phone number for the user
Empty String or null will delete the subscriber attribute.
Set this property to your proxy URL before configuring Purchases only if you've received a proxy key value from your RevenueCat contact.
Proxy URL as a string.
Subscriber attribute associated with the push token for the user
Empty String or null will delete the subscriber attribute.
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
Shows in-app messages available from the App Store or Google Play. You need to disable messages from showing automatically using [PurchasesConfiguration.shouldShowInAppMessagesAutomatically].
Note: In iOS, this requires version 16+. In older versions the promise will be resolved successfully immediately.
An array of message types that the stores can display inside your app. Must be one of [IN_APP_MESSAGE_TYPE]. By default, is undefined and all message types will be shown.
This method will send a purchase to the RevenueCat backend. This function should only be called if you are in Amazon observer mode or performing a client side migration of your current users to RevenueCat.
The receipt IDs are cached if successfully posted so they are not posted more than once.
Product ID associated to the purchase.
ReceiptId that represents the Amazon purchase.
Amazon's userID. This parameter will be ignored when syncing a Google purchase.
Product's currency code in ISO 4217 format.
Product's price.
Product ID associated to the purchase.
ReceiptId that represents the Amazon purchase.
Amazon's userID. This parameter will be ignored when syncing a Google purchase.
Product's currency code in ISO 4217 format.
Product's price.
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.
Generated using TypeDoc
Enum for attribution networks