RevenueCat
Set up RevenueCat for in-app purchases on iOS, Android, and macOS.
This guide primarily focuses on iOS and macOS, as RevenueCat integration with Android is still in progress and has not yet been fully tested. Updates for Android will be added once testing is complete.
All iOS setup steps also apply to macOS. To enable In-App Purchases on macOS, follow the additional step described in this section.
Apple/Google Stores Setup
Create an App
Go to your App Store Connect → Apps
→ +
symbol (upper left) → New App
- Platforms > check the platforms you are aiming for (
iOS
,macOS
). - Name > give a meaningful name.
- Primary Language > select your primary language.
- Bundle ID > select the App ID you created in the Apple Developer Console, or create a new one as suggested in the form.
- SKU > a unique identifier for your app, can be anything you like.
- User Access > select
Full Access
(recommended).
iOS Product Setup
Follow this well-written guide from RevenueCat to set up your iOS products: iOS Products Setup.
RevenueCat integration with Android is still in progress and has not yet been fully tested. Updates for Android will be added once testing is complete.
RevenueCat's Projects & Apps
Create New project
Go to RC dashboard → Projects
(nav bar) → + Create new project
- Project Name > The name of your project.
→ Create Project
Create New app
Go to RC dashboard → Projects
(nav bar) → <your project>
→ Apps
(sidebar) → Add an app
Choose App Store
as the platform.
-
App Name > The name of your app.
-
App Bundle ID > can be found:
- Open the
ios
folder of your Flutter project in Xcode (right click on the folder →Open in Xcode
) Runner
(sidebar) →General
(tab bar) →Runner
(TARGETS
sidebar) →Identity
→Bundle Identifier
- Open the
-
App Store Connect App-Specific Shared Secret > follow the steps:
Go to App Store Connect →
Apps
→ select your app →App Information
(sidebar, under General) → scroll toApp-Specific Shared Secret
→Manage
→Generate
→ copy the generated secret and paste into RevenueCat.
→ Save changes
(upper right)
In-app purchase key configuration
Go to App Store Connect → Users and Access
→ Integrations
(tab bar) → In-App Purchase
(sidebar, under Keys) → +
symbol (upper left) → Generate In-App Purchase Key
- Name > give a meaningful name
→
Generate
Once your key is generated, it will appear in Active Keys and you get one shot to download it. Select Download API Key and store the file in a safe place, you'll need to upload this to RevenueCat in the next step.
→ Download API Key
→ Go back to RevenueCat:
- P8 key file from App Store Connect > Upload the downloaded file.
- Key ID > Copy the Key ID from the IAP key details page in App Store Connect.
- Issuer ID > Copy the Issuer ID from the IAP key details page in App Store Connect.
→ Save changes
(upper right)
App Store Connect API
Go to App Store Connect → Users and Access
→ Integrations
(tab bar) → App Store Connect API
(sidebar, under Keys) → +
symbol (upper left)
- Name > give a meaningful name
- Access >
App Manager
→ Generate
→ Download the generated key. You will receive a .p8
key file → Also take note of the Issuer ID (shown above the "Active" table).
This key can only be downloaded once, so make sure you store it in a safe location.
→ Go back to RevenueCat:
- P8 key file from App Store Connect > Upload the downloaded file.
- Key ID > Copy the Key ID from the IAP key details page in App Store Connect.
- Issuer ID > Copy the Issuer ID from the IAP key details page in App Store Connect.
- Vendor number > Go to App Store Connect →
Payments and Financial Reports
→ look for the Vendor # in the top left corner of the page.
→ Save changes
(upper right)
Apple Server to Server notification settings
Go to RC dashboard → Projects
(nav bar) → <your project>
→ (under Apps, in the sidebar) select your App Store project → Scroll to the Apple Server to Server notification settings section → copy the entire URL provided under Apple Server Notification URL.
Go to App Store Connect → Apps
→ select your app → App Information
(sidebar, under General) → scroll to App Store Server Notifications
→ paste the entire URL from RevenueCat in both the Production Server URL
field and the Sandbox Server URL
field.
→ Check the box Track new purchases from server-to-server notifications
(optional, but recommended) → Save changes
(upper right)
RevenueCat integration with Android is still in progress and has not yet been fully tested. Updates for Android will be added once testing is complete.
Offerings
After setting up your pricing in stores and your app in RevenueCat, you can now create your offerings.
Import Products
To import your products from the stores to RevenueCat.
Go to your RevenueCat Project Dashboard → Products
(sidebar, under Product catalog) → Import
(next to + New
button)
Setup Entitlements
Create Entitlements
Go to your RevenueCat Project Dashboard → Entitlements
(sidebar, under Product catalog) → + New
(upper right)
- Identifier > e.g.
basic
,premium
, etc. - Description > give a meaningful description of what this entitlement is about.
→ Add
Attach Products to Entitlements
Open the entitlement you just created → Attach
(upper right in Associated Products tab bar) → select the products you want to attach to this entitlement
Source: RC Entitlements
Add Offerings to Supabase
To display your created offerings on the Floot app paywall, you need to add them to your database. This assumes you have already imported and configured your offerings in RevenueCat.
Adding Entitlements
In your database, entitlements are represented as entries in the plans
table.
Open RC Entitlement
Go to RevenueCat Project Dashboard → Entitlements
→ open your created entitlement
Add Entitlement to Supabase
Use this SQL snippet to add entitlements to your Supabase database (don't forget to update the columns). You can run it in the SQL editor of your Supabase project.
Tip
When running Supabase locally, you can run this SQL snippet in the supabase/db_seeds/*.sql
file to seed your database with the entitlements.
INSERT INTO
plans (id, name, provider, description, platform, active)
VALUES
('entlxxx123', 'Basic', 'revenuecat', 'Perfect for getting started.', 'android', TRUE),
('entlxxx321', 'Premium', 'revenuecat', 'Unlock everything.', 'apple', TRUE);
This snippet inserts two plans: a Basic plan for Android devices and a Premium plan for Apple platforms (iOS, macOS).
id
> should be RevenueCat Entitlement ID. Can be found underRevenueCat ID
.name
> if you are using both Stripe and RevenueCat, names should be the same (case sensitive), otherwise use it as you like.provider
> should berevenuecat
.platform
> possible values areandroid
orapple
.active
> ifFALSE
it won't show up on the paywall. Can be useful if you don't want to offer a plan anymore.
Adding Products
In your database, products are represented as entries in the prices
table.
Open RC Entitlement Products
Go to RevenueCat Project Dashboard → Entitlements
→ your created entitlement → Associated Products
Add Products to Supabase
Use this SQL snippet to add products to your Supabase database. You can run it in the SQL editor of your Supabase project.
Tip
When running Supabase locally, you can add these products by including the SQL snippet in your supabase/db_seeds/*.sql
file.
Note: Since products reference entitlements, make sure to insert the entitlements first.
INSERT INTO
prices (id, plan_id, amount, currency, interval, type, active)
VALUES
('myapp_999_1m_00', 'entlxxx123', 9.99, 'usd', 'monthly', 'recurring', TRUE),
('myapp_9999_1y_00', 'entlxxx123', 99.99, 'usd', 'yearly', 'recurring', TRUE),
('myapp_2999_1m_00', 'entlxxx321', 29.99, 'usd', 'monthly', 'recurring', TRUE),
('myapp_29999_1y_00', 'entlxxx321', 299.99, 'usd', 'yearly', 'recurring', TRUE);
This snippet inserts four products: each plan (entitlement) gets a monthly and a yearly price.
id
> should be the same as in the store (eg:myapp_999_1m_00
).plan_id
> the entitlement id this product is attached to.amount
> price set for this product in the store.currency
> currency set for this product in the store.interval
> based on the price duration you set in the store, look atprice_interval
definition insupabase/migrations/*_init.sql
and set the value accordingly. Most common areweekly
,monthly
andyearly
.type
> possible values areone_time
orrecurring
.active
> ifFALSE
it won't show up on the paywall. Can be useful if you don't want to offer a price anymore.
Webhooks Setup
Create Webhook
Floot uses webhooks to handle events from RevenueCat, such as subscription updates or cancellations. This allows the app to keep the user's access in sync with their subscription status.
Go to RevenueCat Project Dashboard → + New
(sidebar, next to Integrations) → Webhooks configure integration
→ Webhooks Add new integration
- Name > give a meaningful name. You can set up multiple webhook URLs, the name helps differentiate them.
- Webhook URL > the endpoint that you want to receive your webhooks. Possible options:
RevenueCat does not accept http
protocol, but there is a solution
using Local Port
Forwarding
with VS Code-based editors. Know that the forward URL generated by this
method is temporary. Meaning you'll have to repeat this process
every-time you quit the editor (mainly the visibility which tends to go
back in private state). To have have a static URL, you can use
Zrok (open source) or Ngrok.
From your code editor, open the terminal.
PORTS
(tab bar) →Forward a Port
→54321
- Right click on created port →
Port Visibility
→Public
- Use the generated endpoint to redirect RevenueCat events to your Supabase local instance, using the following format:
<generated.forward.address>/functions/v1/revenuecat-webhook
Example generated endpoint:
https://3k5jk495-54321.abc1.devtunnels.ms/functions/v1/revenuecat-webhook
https://<project-id>.supabase.co/functions/v1/revenuecat-webhook
https://<your-domain>:54321/functions/v1/revenuecat-webhook
- Authorization header value > for security reasons an HTTP authorization header is mandatory, so you need to generate one.
Generate Credentials
Based on your development environment, you can generate the credentials in different ways:
bash echo -n <username>:<password> | base64
Use this website: blitter.se
The username and password can be anything you like. Also, you will need the generated key for the next steps. So keep a note of it.
Set Authorization Header
Go back to RevenueCat → Authorization header value
→ paste the generated key in the format:
Bearer <generated_key>
Example:
Bearer dXNlcm5hbWU6cGFzc3dvcmQ=
Make sure to keep "Bearer " in front of the generated key. This is important for the authorization to work correctly.
- Environment to send events for > select whether to send events for production purchases, sandbox purchases, or both
- Apps (under Events filter) > Select if the webhook events should be sent only for one app or for all apps of the project. Generally, you can leave it as is
All apps
, meaning all apps will receive the events. - Event type (under Events filter) > select the events you want to receive. You can leave it as is
All events
, meaning all events will be sent.
→ Add webhook
(upper right)
Source: RC Webhooks
Floot App Setup
Once you have completed the RevenueCat setup, you can proceed to configure your Floot app to use RevenueCat for in-app purchases.
Enable In-App Purchases capability
- Open your
ios
ormacos
folder in Xcode (right click on the folder →Open in Xcode
) - Go to
Runner
(under "TARGETS") ->Signing & Capabilities
- Click on the
+ Capability
button to add a capability - Add
In-App Purchase
Environment Variables
Flutter
Go to your RevenueCat Project Dashboard → open your App Store app (under Apps sidebar) → look for the Public API key
section → copy the key
value and paste it in your .env*
file as follows:
REVENUECAT_PUBLIC_APPLE_KEY=<your_revenuecat_public_key>
Supabase
Set the webhook secret environment variable in your Supabase project to verify incoming RevenueCat events. This value must match the Authorization header value (without Bearer
) you configured when creating the webhook in RevenueCat. If you need to generate a new secret, follow the instructions in the Create Webhook section.
REVENUECAT_WEBHOOK_SECRET=<your_generated_auth_header_value>
Ensure that the value of REVENUECAT_WEBHOOK_SECRET
does not include the Bearer
prefix, use only the base64-encoded credentials.
RevenueCat integration with Android is still in progress and has not yet been fully tested. Updates for Android will be added once testing is complete.
Handling business logic
Subscriptions
Subscription access is managed automatically based on the duration you configure when creating your offering. If you need to implement additional logic, such as awarding credits, coins, or other custom actions for subscribers, handle it in the following file: supabase/functions/revenuecat-webhook/_events/rc_sub_handlers.ts
.
One time payments
To handle one-time payments (non-renewing purchase), edit the file supabase/functions/revenuecat-webhook/_events/non_renewing_purchase.ts
by following the comments that starts with // ! ...
In-App Purchase on macOS
By default, RevenueCat integration in Floot supports only mobile platforms (iOS & Android). If you are building a macOS app with in-app purchases for distribution via the App Store, you need to explicitly enable macOS support.
To do this, simply set the following environment variable:
ENABLE_IAP_MACOS=true
Sandbox Testing
You don't need to make real purchases in order to test your subscriptions. You can make sure your subscriptions have been implemented correctly by using the sandbox environments. These environments will generally behave as the real stores, without incurring any costs.
For detailed instructions on setting up sandbox testing for Apple platforms, refer to the Apple App Store & TestFlight guide from RevenueCat.
In practice, testing in-app purchases on a real device is the most reliable and straightforward approach.
For detailed instructions on setting up sandbox testing for Android platforms, refer to the Google Play Store guide from RevenueCat.
RevenueCat integration with Android is still in progress and has not yet been fully tested. Updates for Android will be added once testing is complete.
Source: RC Sandbox Testing