mirror of
https://github.com/jonasbark/swiftcontrol.git
synced 2026-02-18 00:17:40 +01:00
4.1 KiB
4.1 KiB
RevenueCat Setup Instructions
Quick Start Guide
Step 1: Get Your RevenueCat API Key
- Sign up at RevenueCat
- Create a new project
- Go to Settings → API Keys
- Copy your API key (starts with
appl_or similar)
Step 2: Configure Products in App Store Connect / Google Play Console
For iOS/macOS:
- Go to App Store Connect
- Select your app → In-App Purchases
- Create a new In-App Purchase:
- Type: Non-Consumable
- Product ID:
lifetime - Display Name: BikeControl Lifetime
- Description: Lifetime access to all BikeControl features
- Price: Set your desired price
For Android:
- Go to Google Play Console
- Select your app → Monetize → In-app products
- Create a new product:
- Product ID:
lifetime - Name: BikeControl Lifetime
- Description: Lifetime access to all BikeControl features
- Price: Set your desired price
- Product ID:
Step 3: Configure RevenueCat Dashboard
-
Add your app to RevenueCat:
- iOS/macOS: Add App Store Connect credentials
- Android: Add Google Play Service Account JSON
-
Create Products:
- Go to Products
- Click Add Product
- Enter Product ID:
lifetime - Link to App Store / Google Play product
-
Create Entitlement:
- Go to Entitlements
- Create new entitlement:
Full Version - Add the
lifetimeproduct to this entitlement
-
Create Offering:
- Go to Offerings
- Create or edit the default offering
- Add
lifetimeproduct - Set as current offering
Step 4: Configure Your Build
Add your RevenueCat API key to your build:
Option A: Environment Variable (Development)
export REVENUECAT_API_KEY="your_api_key_here"
flutter run
Option B: Build Command (Production)
flutter build ios --dart-define=REVENUECAT_API_KEY=your_api_key_here
flutter build apk --dart-define=REVENUECAT_API_KEY=your_api_key_here
flutter build macos --dart-define=REVENUECAT_API_KEY=your_api_key_here
Option C: CI/CD (Recommended)
Add REVENUECAT_API_KEY as a secret in your CI/CD environment:
GitHub Actions:
- name: Build
env:
REVENUECAT_API_KEY: ${{ secrets.REVENUECAT_API_KEY }}
run: flutter build ios --dart-define=REVENUECAT_API_KEY=$REVENUECAT_API_KEY
Step 5: Test Your Integration
- Build and Run: Build your app with the API key configured
- Check Logs: Look for "RevenueCat initialized successfully"
- Test Purchase Flow:
- Click "Unlock Full Version"
- Should see RevenueCat paywall
- Complete test purchase (use sandbox/test account)
- Verify Entitlement: After purchase, should see "Full Version" status
- Test Customer Center: Click "Manage" button when purchased
Step 6: Production Checklist
- RevenueCat project created and configured
- Products created in App Store Connect / Google Play Console
- Products imported to RevenueCat
- "Full Version" entitlement created and linked to
lifetimeproduct - Offering created with
lifetimeproduct - API key added to CI/CD secrets
- Test purchase completed successfully
- Sandbox testing completed
- Production testing completed (TestFlight / Internal Testing)
Important Notes
- Never commit your API key to source control
- Use sandbox accounts for testing
- Product IDs must match across App Store/Google Play and RevenueCat
- Entitlement name must be exactly
Full Version - Windows users will continue to use Windows Store IAP
Fallback Behavior
If RevenueCat API key is not configured:
- App will automatically use legacy IAP service
- All features will continue to work
- iOS/macOS will use
in_app_purchasepackage - Android will use
in_app_purchasepackage - Windows will use
windows_iappackage
Support
For issues with:
- RevenueCat SDK: Check RevenueCat Docs
- Product Setup: Review platform-specific documentation
- BikeControl Integration: See
REVENUECAT_INTEGRATION.md