This is the complete example repository for the RevenueCat blog article on building a single Expo app with subscriptions across iOS, Android, and Web platforms.
This project demonstrates how to implement cross-platform subscriptions using RevenueCat Web Billing and the web SDK. The app works seamlessly across iOS, Android, and Web platforms, allowing users to subscribe on any platform and unlock premium access everywhere.
The tutorial walks through building a simple React Native app with Expo that implements RevenueCat subscriptions across all three platforms. We minimize platform-specific code while covering all key setup steps.
- Cross-platform subscriptions: Single codebase supporting iOS, Android, and Web
- RevenueCat integration: Unified subscription management across platforms
- Platform-specific modules: Uses React Native's platform extensions (.native.ts, .web.ts)
- Expo Router: Modern navigation with tab-based interface
- Unified entitlements: Shared subscription status across all platforms
├── app/ # Expo Router app directory
│ ├── (tabs)/ # Tab-based navigation
│ └── _layout.tsx # Root layout
├── components/ # Reusable UI components
├── hooks/ # Custom React hooks
├── lib/ # Platform-specific payment logic
│ ├── payments.native.ts # iOS/Android implementation
│ └── payments.web.ts # Web implementation
└── constants/ # App constants and colors
Before starting, you'll need:
- A RevenueCat account
- An App Store Connect account (for iOS)
- A Google Play Console account (for Android)
- A Stripe account (for Web Billing)
- Visit the RevenueCat website
- Click "Sign Up" or "Get Started"
- Follow the on-screen instructions to create your account
- Verify your email address
- Access the RevenueCat dashboard to begin configuration
- Log into App Store Connect
- Navigate to My Apps
- Select your app
- Go to Features tab → In-App Purchases
- Create a new subscription:
- Reference name:
1_month_premium_ios
- Product ID:
1_month_premium_ios
- Duration: 1 Month
- Set appropriate pricing tier
- Add localized display names and descriptions
- Reference name:
- Configure Google Play Console connection with RevenueCat
- Navigate to Google Play Console → App Applications
- Select Products → Subscriptions
- Create subscription with matching details to iOS version
- Add base plan with 1-month auto-renewing period
- Go to RevenueCat dashboard
- Navigate to project settings
- Under "Products" click "New"
- Select Web Billing App
- Configure monthly subscription matching iOS/Android versions
npm install react-native-purchases
npm install @revenuecat/purchases-js
The project uses platform-specific extensions:
.native.ts
for iOS and Android.web.ts
for web platform
Key components:
initializePayments
: Initializes RevenueCat SDKusePackages
: Handles package display and purchases
- Clone this repository
- Install dependencies:
npm install
- Configure your RevenueCat API keys in the hooks
- Run the development build:
npx expo run:ios # For iOS npx expo run:android # For Android npx expo start --web # For Web
For testing subscriptions:
- iOS: Use sandbox testing accounts
- Android: Use test accounts
- Web: Use Stripe test mode
- Expo Go does not support react-native-purchases
- Development builds are required for testing
- Platform-specific code is handled through React Native's platform extensions
- Original Blog Article
- RevenueCat iOS Setup Guide
- RevenueCat Android Setup Guide
- RevenueCat Web Billing Guide
- Expo Development Builds
This project is provided as an example for the RevenueCat blog tutorial. Feel free to use this code as a reference for your own projects.