๐ Revenue Cat
Set up subscription management with RevenueCat for iOS and Android.
โ ๏ธ Don't want to use RevenueCat? If you don't need subscription management, you can remove RevenueCat by:
- Remove
RevenueCatProviderfrom 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=trueto your Expo project environment variables on expo.dev to prevent build crashes - Build your app first - Use
eas buildto create your app - Submit to stores - Use
eas submitto upload your app to App Store Connect and/or Google Play Console - 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.
- iOS: App submitted and processed in App Store Connect + subscription products created
- Android: App uploaded to Google Play Console (at least internal testing) + subscription products created
๐ Create Revenue Cat Account
- Go to revenuecat.com
- Create free account
- Create new project with your app name
๐ iOS Configuration
Step 1: Create App Store Products
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
Step 2: Add iOS App to RevenueCat
- Go to RevenueCat Dashboard
- Go to Platforms (make sure you're on the correct project)
- Click on Add app platform
- Select App Store
- Enter:
- App Name: Your app name
- 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:
- P8 key file from App Store Connect
- Key ID (extracted from the P8 key file)
- Issuer ID from App Store Connect
- Apple Server to Server notification settings: Enable to receive notifications
-
App Store Connect API:
- P8 key file from App Store Connect
- Key ID and Issuer ID
๐ก Note: You'll find your Public API Key at the bottom of the page. Copy it - you'll need it for your .env.local file as EXPO_PUBLIC_RC_IOS.
๐ค Android Configuration
Step 1: Create Google Play Products
- Go to Google Play Console
- Select your app
- Go to Monetization โ Products โ Subscriptions
- Click Create subscription
- Enter:
- Product ID:
premium_monthly(use same ID as iOS for consistency) - Name: Premium Monthly
- Description: Monthly premium subscription
- Product ID:
- Add a Base plan:
- Base plan ID:
monthly - Renewal type: Auto-renewing
- Billing period: 1 Month
- Price: Set your pricing
- Base plan ID:
- Activate the subscription
โ ๏ธ Important: You must have uploaded at least one APK/AAB to Google Play Console (even in internal testing) before you can create subscription products.
Step 2: Create Google Cloud Service Account
RevenueCat needs a service account to communicate with Google Play.
2.1 Enable APIs
- Go to Google Cloud Console
- Create a new project or select an existing one
- Go to APIs & Services โ Library
- Search and enable these APIs:
- Google Play Android Developer API
- Google Play Developer Reporting API
2.2 Create Service Account
- Go to APIs & Services โ Credentials
- Click Create Credentials โ Service Account
- Enter a name (e.g., "RevenueCat Service Account")
- Click Create and Continue
- Add these roles:
- Pub/Sub Editor (for real-time notifications)
- Monitoring Viewer
- Click Done
2.3 Generate JSON Key
- In Service Accounts, click on the account you just created
- Go to Keys tab
- Click Add Key โ Create new key
- Select JSON format
- Click Create and download the file
โ ๏ธ Keep this JSON file safe! It contains credentials that give access to your Google Play data.
Step 3: Grant Access in Google Play Console
- Go to Google Play Console
- Click Users and permissions (in the left menu)
- Click Invite new users
- Enter the service account email (format:
name@project-id.iam.gserviceaccount.com) - Under App permissions, select your app
- Under Account permissions, enable:
- โ View app information and download bulk reports (read-only)
- โ View financial data, orders, and cancellation survey responses
- โ Manage orders and subscriptions
- Click Invite user
- Accept the invitation (check "Active" status)
๐ก Activation Time: Google may take up to 36 hours to validate credentials.
Speed up activation: Go to your app โ Monetization โ Products โ Edit any product description and save. This forces credential validation.
Step 4: Add Android App to RevenueCat
- Go to RevenueCat Dashboard
- Go to Platforms
- Click Add app platform โ Google Play Store
- Enter:
- App Name: Your app name
- Package Name:
com.yourcompany.yourapp(must matchapp.json)
- Upload the JSON service account key file
- Click Save
๐ก Note: You'll find your Public API Key at the bottom of the page. Copy it - you'll need it for your .env.local file as EXPO_PUBLIC_RC_ANDROID.
๐ฆ RevenueCat Product Configuration
These steps are shared for both iOS and Android.
Create an Entitlement
- Go to Product catalog โ Entitlements
- Click New entitlement
- Enter:
- Identifier:
premium(or your preferred name) - Description: Premium access
- Identifier:
๐ก Important: Remember your Entitlement Identifier - add it to .env.local as EXPO_PUBLIC_RC_SUBSCRIPTION_NAME.
Create Products
โ ๏ธ Important: Products in App Store Connect must have status "Ready to Submit" and Google Play subscriptions must be "Active" to be detected by RevenueCat.
- Go to Product catalog โ Products
- Click New product
-
Import Products (Recommended):
- Click Import Products
- Select iOS or Android platform
- RevenueCat will find your subscriptions automatically
- Click Import
-
Link to Entitlement:
- Select the imported product
- Attach the entitlement you created
Repeat for both platforms to have iOS and Android products linked to the same entitlement.
Create an Offering
- Go to Product catalog โ Offerings
- Click New offering
- Enter:
- Identifier:
default - Display Name: Default Offering
- Identifier:
- Click Add Package
- Configure:
- Identifier: Select duration (e.g.,
$rc_monthly) - Description: Monthly subscription
- Products: Add both iOS and Android products
- Identifier: Select duration (e.g.,
- Click Save
Create a Paywall
- Go to Paywalls
- Click New paywall
- Select a template
- On the right side, select your Offering
- Customize the paywall design
- Click Save
๐ง Environment Variables
Add these to your .env.local:
# RevenueCat iOS API Key
EXPO_PUBLIC_RC_IOS=appl_xxxxxxxxxxxx
# RevenueCat Android API Key
EXPO_PUBLIC_RC_ANDROID=goog_xxxxxxxxxxxx
# Entitlement identifier (must match RevenueCat)
EXPO_PUBLIC_RC_SUBSCRIPTION_NAME=premium
Platform Summary
| Variable | Platform | Where to find |
|---|---|---|
EXPO_PUBLIC_RC_IOS | iOS | RevenueCat โ Platforms โ App Store โ Public API Key |
EXPO_PUBLIC_RC_ANDROID | Android | RevenueCat โ Platforms โ Google Play โ Public API Key |
EXPO_PUBLIC_RC_SUBSCRIPTION_NAME | Both | RevenueCat โ Product catalog โ Entitlements โ Identifier |
๐จ REMINDER: Configure ALL RevenueCat environment variables. If RevenueCatProvider is in your code without proper configuration, your app will stay stuck on the splash screen!
๐ก Production Builds: Add ALL environment variables to expo.dev โ Your Project โ Settings โ Environment variables.
๐ Troubleshooting
Android: Credentials not working
- Wait 36 hours - Google needs time to validate
- Force validation - Edit any product in Google Play Console and save
- Check permissions - Ensure service account has all required permissions
- Verify package name - Must match exactly in Google Play, RevenueCat, and
app.json
Android: Products not showing
- Ensure you've uploaded at least one APK/AAB to Google Play
- Subscription must be Active (not Draft)
- Base plan must be configured with pricing
iOS: Products not showing
- Products must have status "Ready to Submit"
- All required metadata must be filled
- Subscription group must exist
App stuck on splash screen
- Check that all
EXPO_PUBLIC_RC_*variables are set - Verify API keys are correct (iOS starts with
appl_, Android withgoog_) - Check RevenueCat dashboard for errors
๐ฏ Next Step
Continue to ๐ก๏ธ Sentry to set up error tracking.
Step 5/11 Complete โ
RevenueCat configured for iOS & Android!
๐ Additional Resources
Official Documentation
- ๐ Expo In-App Purchases Guide - Complete guide to implementing in-app purchases with Expo and RevenueCat
- ๐ RevenueCat - Creating Play Service Credentials - Official guide for Google Play setup
- ๐ RevenueCat - Google Play Checklists - Verification checklist
