💸

In-app purchases and subscriptions (RevenueCat)

Use in-app purchases with the RevenueCat platform to create freemium apps, monetize your content, and much more!
Here we have the docs necessary to configure In-app purchases in Bravo. Use in-app purchases with the RevenueCat platform to create freemium apps, monetize your content, and much more!
This feature is available in the Business App plan. For Android, you'll need to have a published app already on Google Play. In case you don't have one, create a publication-ready app and follow this guide to publish it.

🔖 The tags

In order to set up in-app purchases, several tags are needed.

Purchase actions

These tags will be used anywhere we want to allow users to do an in-app purchase.
Purchase action
Price
[action:purchase:<package_id>]
Triggers the purchase action. This will normally need to be added in a button where users can execute the purchase. <package_id> will be the identifier of the package associated to the default offering in RevenueCat (see screenshot below).
[price:<package_id>]
Use this tag, together with the {price} expression in the design file, to show the price of the purchase. Check out our example design to see an example. package_id will be the same one used in the purchase action.

Paywall

[page:paywall]
Use this tag to create a paywall page. This page will be displayed every time users try to access content that requires a purchase. This page will usually contain the UI elements with the [action:purchase:<package_id>] tag.

Access control

[require-purchases:<entitlement_ids>]
Use this tag to create pages that only users who made a purchase can access.
The access control is based on entitlements, which represents the access level a particular user has. Each entitlement can be associated to more than one package: for instance, in case we want to create monthly and yearly subscriptions. However, all the packages inside the same entitlement will grant access to the same content.
In the tag, separate the entitlement IDs with commas, in case there’s more than one. For example, [require-purchases:basic,medium]

Conditional visibility for purchases

[with-purchases:<entitlement_ids>]
Allows to show/hide containers, and components depending on the entitlement, allowing a lot of flexibility that can be already configured by tags in Figma (no API calls needed).
Separate the entitlement IDs with commas, in case there’s more than one. For example, [with-purchases:basic,medium]

Restore purchases action

[action:restore-purchases]
This is used to restore purchases in case the app is deleted, a new device will be used, etc. It's a requirement from Apple to include it.

⚒️ Configuration in RevenueCat and in the app stores

iOS configuration

  • Configure the products/subscriptions on appstoreconnect, usually the ids are <bundle_id>.<product_id>
  • Configure an account in revenuecat, create an app
  • Create the entitlements, offers and products in revenuecat
  • Entitlements are like the different levels
  • Products is all subscription types, apple purchase products
  • Offerings is a group products, that are available ins a specific time, mostly use for marketing purposes
  • Attach in the entitlements the products
  • Create one offering, only “default” offering is supported!
  • Attach the products to that offer
  • We create offerings with “Custom” if we have several monthly products for example, using custom allow us to use the idea we want.

Android configuration

RevenueCat setup

In order to set up the RevenueCat integration on Android, follow the steps below:
  • Configure an account in RevenueCat if you don’t have one, and create project. Then, create an app in that project (remember you need two different apps for Android and iOS)
  • After registering your app, we recommend setting up Platform Server Notifications. These notifications aren't required but will speed up webhooks and integration delivery times and reduce lag time updating your subscribers. Bear in mind this setup is for advanced users.
  • Create your products, entitlements, and offering in RevenueCat. To clarify the concepts:
    • Products are all your different subscription types (e.g. basic, medium, pro)
    • Entitlements are the different “entrance levels” (e.g. one entitlement must have at least one product, but may have more than one)
    • Offerings are a group of products, that are available ins a specific time, mostly use for marketing purposes. We only support one “default” offering.
  • First create all your products. In our Recipes example, the list of products looks like this (note you need to create separate products for Android and iOS)
  • Then, create all your entitlements (normally 1 entitlement = 1 product, but this depends on each particular case)
  • After you have products and entitlements, you need to attach each product to its correspondent entitlement. In our Recipes example, we added 2 products to each entitlement (1 per iOS and 1 per Android):
  • Create an offering: “default” (the only one offering supported for now) and add a description
  • Enter the created offering, and click on “ + New” to add a Package
  • Select “Custom” in the first dropdown, and then enter the Identifier name (i.e. your product name) and a description
  • Enter in the created package, and click on Attach
  • In the popup, you should see all the products you added in previous steps. Attach the ones that corresponds to the package. For our example, in the pro package, we will add the “pro products” for Android and IOS:
  • Click on attach. Repeat this process for all the packages you have. When you’re done, you should see in the default offering all the packages (a.k.a subscriptions) that you have.

Bravo setup

After setting up your Android app in RevenueCat, you'll need to copy the Android API key and paste it in the Bravo settings for the RevenueCat integration:
Once you've copy/pasted the key, press Save and continue to the next section of this guide.

Google Play setup

Finally, you need to create your subscriptions in Google Play. Please read carefully the instructions, since the steps need to be followed thoroughly. The right steps to create a subscriptions are:
  1. 1.
    Need to have an app published and live in Google Play (mandatory).
2. Create a Closed testing track, and upload an AAB with a newer version. Wait until the app is approved (need to be reviewed by Google even in this Closed testing track)
3. Need to add a tester. To do that, add the tester email in the
The tested needs to join your test either via Android or web:
4. Once the previous steps are done correctly, users should be able to create a subscription in the Monetise - Products -Subscriptions section in the left side menu. If users see the screenshot below, it means steps 1 to 3 are not completed correctly
5. Click on Create subscription and enter Product ID and Name (this product ID will be the same you enter in RevenueCat)
6. Click on add a base plan, chose base plan id and select auto-renewing
7. IMPORTANT: Select Manage country/region availability in blue. If you try to add a country directly in the Edit base plan section, you might get unexpected errors trying to save
8. Unselect 95 countries/regions, search your country, check the box and click apply
9. Click on Price, enter a price and save
10. Click save
11. Click activate
12. Go back to the subscriptions main page, and if you did everything correctly, you should see your plan as active
To recap, at this point you should have:
  • Your app published in Google Play
  • A new version with the RevenueCat library integrated (new build requested in Bravo), published in a Closed testing track
  • At least one tested that joined your testing track
  • All your subscriptions created in Google Play
Now, you should be able to test the in-app purchases with the tester user you've created. Once you're ready to go, move the app to the publication track and it will be available for all users!