RevenueCat
Actions listed under this help you purchase the paid items or subscriptions using RevenueCat. This includes displaying a paywall, purchasing items, and restoring subscriptions.
.gif?alt=media&token=f303a915-8d7d-40e6-9c7a-808823b0aa95)
RevenueCat actions
Below are the types of RevenueCat action:
- 1.Paywall: This checks whether a user has purchased an item.
- 2.Purchase: This allows you to purchase the item.
- 3.Restore Purchases: Using this action, you can re-activate the in-app purchase that had previously been purchased.
Let's try building the subscription flow for an app that only allows users to watch premium movies if they are subscribed. Here is how it looks:

Subscription flow
As the figure above shows, you must create two pages (MovieDetails and WatchMovie) with one Bottom Sheet to display the Paywall.
To build a subscription flow, you must use PayWall, Purchase, and Restore Purchases actions.
Here are the step-by-step instructions:
Let's build a UI for the subscription flow.
You can skip this step if you already have a UI ready.
Add the Movie_Details page from the template and modify the Add to Favorites button as per your need. Here's how it looks:

MovieDetails page
Create the Paywall UI in a Bottom Sheet widget to display the subscription options (e.g., monthly, yearly) by following the instructions here.
Here's how it looks:

Paywall bottom sheet

WatchMovie page
Once you have designed the subscription flow, you can add an action to see if the user is subscribed or not. If not, you can open the Paywall (asking to buy a subscription).
The Paywall is typically a page or component displaying the list of suggested purchases.
To see if a user is subscribed.
- Select the Widget (e.g., Button) on which you want to define the action.
- Select Actions from the Properties panel (the right menu), and click Open. This will open an Action flow Editor in a new popup window.
- Click on the + Add Action.
- On the right side, search and select the Paywall (under RevenueCat) action.
- Under the Entitlement ID section, set the Value Source and Value of the entitlement. (e.g., Value Source -> Specific Value and Value -> [name_of_entitlement]).
- Click on the plus button and select Add Conditional. On the right side (Set Condition for Action), select the User Has RevenueCat Entitlement. This condition checks if a user is subscribed.

Displaying paywall
To display the subscription details, such as price, description, etc., inside the Paywall, you need to retrieve this information from RevenueCat.
To retrieve details of the subscription option:
- Select the Text widget from the widget tree or the canvas area.
- Move to the property panel and click on the Set from Variable text. (This will open a new panel)
- Set the Source to RevenueCat.
- Set the Available Options to Current Offerings.
- Set the Options to the appropriate value from the list. For example, select Monthly Package if you want to retrieve the price for the monthly package.
- Set the Available Options (second) to Price String. This will display the price of the monthly package.
- Click Confirm.
Other attributes of a package include an Identifier, Description, Product Price, and Price String.

Retrieving subscription details
To allow users to purchase a subscription:
- Select the Widget (e.g., Button) on which you want to define the action.
- Select Actions from the Properties panel (the right menu), and click Open. This will open an Action flow Editor in a new popup window.
- Click on the + Add Action.
- On the right side, search and select the Purchase (under RevenueCat) action.
- Under the Package ID section, set the Value Source to From Variable.
- Set the Source to Revenue Cat and choose the Current Offerings.
- Set the Options to the appropriate value from the list. For example, select Monthly Package if you want users to buy a monthly plan.
- Set the Available Options (second) to Package Identifier.
- Finally, set the Action Output Variable Name (e.g., didPurchase). This will be used to check if the purchase was successful.
- Click on the plus button and select Add Conditional.
- On the right side (Set Condition for Action), select the Action Output > [action_output_variable_name] (e.g, didPurchase).
- Under the TRUE section, add an action to navigate back, followed by an action to navigate to the MovieDetails page.

Purchasing subscription
Restoring a purchase helps the user re-activate the subscription he has already paid for. This is helpful when a user has reinstalled the app or logged in to a new device.
- A good practice is to allow users to manually restore the purchase by showing a button or text (maybe on a paywall/settings page).
To allow a user to restore purchase:
- Select the Widget (e.g., Text or Button) on which you want to define the action.
- Select Actions from the Properties panel (the right menu), and click + Add Action.
- Search and select the Restore Purchases (under RevenueCat) action.

Restoring purchases
Last modified 7mo ago