๐ Revenue Cat
Set up subscription management with RevenueCat.
โ ๏ธ Don't want to use RevenueCat? If you don't need subscription management, you can remove RevenueCat by:
- Remove
RevenueCatProvider
from your app layout (app/_layout.tsx
):
// Remove this wrapper:
// <RevenueCatProvider>
// Keep only:
<QueryClientProvider client={queryClient}>
<ThemeProvider>
<AuthProvider>
<AppInitializer>
{/* Your app content */}
</AppInitializer>
</AuthProvider>
</ThemeProvider>
</QueryClientProvider>
- Skip this entire setup page
๐จ CRITICAL WARNING: If you keep the RevenueCatProvider
in your code but don't configure the RevenueCat environment variables, your app will stay stuck on the splash screen and won't load!
Prerequisites
โ ๏ธ IMPORTANT: Before setting up Revenue Cat, you must:
- Complete previous setup steps - Finish all configuration steps up to Sentry
- Add critical build variable - Add
SENTRY_DISABLE_AUTO_UPLOAD=true
to your Expo project environment variables on expo.dev to prevent build crashes - Build your app first - Use
eas build
to create your app - Submit to App Store Connect - Use
eas submit
to upload your app - Create subscription products - You can create products immediately after submission
If you haven't built yet: Skip Revenue Cat for now and return after building.
- App submitted and processed in App Store Connect
- Subscription/purchase products created in App Store Connect
๐ฑ First: Create App Store Products
1. App Store Connect Setup
Before configuring Revenue Cat, create your subscription products:
- Go to App Store Connect
- Select your app (must be already submitted via EAS)
- Go to Features โ In-App Purchases
-
Create Subscription Group first:
- Click + next to "Subscription Groups"
- Reference Name:
Premium Subscriptions
- App Name: Your app name in App Store
-
Create subscription in the group:
- Click + inside your subscription group
- Reference Name: Premium Monthly
- Product ID:
premium_monthly
(remember this!) - Price: Set your pricing
- Subscription Duration: 1 Month
๐ Create Revenue Cat Account
- Go to revenuecat.com
- Create free account
- Create new project: FoodieApp
Configuration for iOS
- Go to revenuecat.com
- Go To Platforms (Make sure you are on the correct project)
- Click on Add app platform
- Select App Store
- On the page Enter:
- App Name:
FoodieApp
- App Bundle ID:
com.yourcompany.yourapp
- App Store Connect App-Specific Shared Secret:
- Go to your app on App Store Connect
- Under "General" โ "App Information"
- Scroll to "App-Specific Shared Secret" and click "Manage" and "Generate"
- In-app purchase key configuration:
- Apple Server to Server notification settings: Allow to receive notifications from Revenue Cat
- App Store Connect API:
- App Name:
- You should get your Public API Key on the bottom of the page
- Copy it and add it to your
.env.local
file asEXPO_PUBLIC_RC_IOS
โ ๏ธ Important: Make sure to follow all the following steps from create an entitlement to create a Paywall
Create an Entitlement
- Go to Product catalog
- Click on Entitlements
- Click on New entitlement:
- Identifier: Choose a unique identifier for the entitlement (e.g.,
premium
,pro
,unlimited
) - Description: Add a description for the entitlement
๐ก Important: Remember your Entitlement Identifier - you'll need to add it to your .env.local
file as EXPO_PUBLIC_RC_SUBSCRIPTION_NAME
.
Create Products/Subscriptions
โ Prerequisites Complete: You should now have your subscription product created in App Store Connect (can be any name you choose).
โ ๏ธ Important: Your products/subscriptions in App Store Connect must have the status "Ready to Submit" to be detectable by Revenue Cat. Make sure to complete all required information for your subscription products.
- Go to Product catalog
- Click on Products
- Click on New product
-
Import Products (Recommended):
- Click Import Products
- Select your iOS app platform
- Revenue Cat will find your subscription automatically
- Click Import to add it to Revenue Cat
-
Manual Alternative:
- Product Identifier: Your App Store Connect Product ID (must match exactly)
- Platform: iOS
-
Link to Entitlement:
- Select the imported product
- Add the entitlement you created above
Create an Offering
โ ๏ธ Prerequisite: You should have a Product/Subscription set up in Revenue Cat to create an offering
- Go to Product catalog
- Click on Offerings
- Click on New offering
- Enter:
- Identifier: Choose a unique identifier for the offering
- Display Name: Add a name for the offering
- Click on ** Add Package**
- Select the product you want to add to the offering:
- Select the Identifier (The duration of the subscription or a custom product)
- Add a Description
- Select the product (The product/subscription you want to add to the offering)
- Click on Save
Create a Paywall
- Go to Paywalls
- Click on New paywall
- Select the paywall you want to create
- On the right side, select an Offering for your Paywall
- Modify the paywall as you want
- Click on Save
๐ง Get API Keys
1. iOS API Key
- In Revenue Cat dashboard, click Platforms
- Select Apple App Store
- At the bottom of the page, you will find the Public API Key
- Copy the Public API Key:
EXPO_PUBLIC_RC_IOS_KEY=appl_your_ios_api_key
๐ก Info: Add subscription management API keys to your environment.
โ Environment Updated
Your .env.local
should now include:
EXPO_PUBLIC_RC_IOS_KEY=appl_...
EXPO_PUBLIC_RC_SUBSCRIPTION_NAME=your_entitlement_identifier
EXPO_PUBLIC_RC_SUBSCRIPTION_NAME
: Must match the Entitlement Identifier you created in Revenue Cat (not the App Store Connect Product ID)
๐จ REMINDER: Make sure to configure ALL RevenueCat environment variables. If you leave the RevenueCatProvider
in your code without proper configuration, your app will stay stuck on the splash screen!
๐ก Production Builds: For production builds, you'll need to add ALL your environment variables to expo.dev โ Your Project โ Settings โ Environment variables.
๐ฏ Next Step
Continue to ๐ก๏ธ Sentry to link error tracking to your app.
Step 5/11 Complete โ
Revenue Cat API keys added!
๐ Additional Resources
Official Documentation
- ๐ Expo In-App Purchases Guide - Complete guide to implementing in-app purchases with Expo and RevenueCat