RevenueCat
RevenueCat is a subscription management platform that simplifies in-app purchases across Android and iOS.
Instead of handling store validation and subscription logic separately for each platform, RevenueCat acts as a centralized backend layer over:
- Google Play Billing (Android)
- Apple StoreKit (iOS)
Twinr integrates directly with RevenueCat to help you:
- Manage subscriptions across platforms
- Validate receipts securely
- Track subscription lifecycle events
- Simplify purchase implementation
- Access analytics and reporting
When Should You Use RevenueCat?
RevenueCat is recommended if:
- You offer subscriptions (monthly, yearly, etc.)
- You support both Android and iOS
- You want centralized subscription control
- You need subscription analytics
- You want easier lifecycle management (renewals, cancellations, upgrades)
If you only need simple one-time purchases, native IAP may be sufficient.
Prerequisites
Before configuring RevenueCat in Twinr, ensure:
- Your app is created in:
- Google Play Console
- Apple App Store Connect
- In-app products or subscriptions are already created in the respective store.
- A RevenueCat account is created.
Step-by-Step Setup Guide
Step 1: Create a RevenueCat Account
- Go to: https://www.revenuecat.com
- Sign up or log in.
- Create a New Project.
- Add both:
- Android App
- iOS App
Step 2: Connect Stores to RevenueCat
Inside RevenueCat dashboard:
For Android:
- Connect Google Play Console
- Sync your products
For iOS:
- Connect App Store Connect
- Sync your subscription products
Products must exist in the stores before adding them to RevenueCat.
Step 3: Configure Products & Entitlements
- Go to Products
- Import or create products
- Create Entitlements (e.g., Premium Access)
- Attach products to entitlements
- Create an Offering
- Set the offering as Current
This step defines what users unlock after purchase.
Step 4: Get RevenueCat API Keys
Inside RevenueCat:
- Go to Project Settings
- Copy:
- Public SDK Key (Android)
- Public SDK Key (iOS)
These keys will be used in Twinr.
Configure RevenueCat in Twinr
📍 Go to:
Twinr Builder → Integrations → Monetisation → In-App Purchase
- Turn on Enable In-App Purchase
- Set Purchase provider to RevenueCat
- Enter:
- Android API key (RevenueCat Public SDK Key)
- iOS API key (RevenueCat Public SDK Key)
- Enter your Response submission URL. This is required with RevenueCat too. It is an endpoint on your own server that receives every purchase result. See Response submission URL below.
- Click Save as draft
- Publish to Production
Once published, RevenueCat integration becomes active.
Response submission URL
After each purchase, the app sends the result to this URL with a POST request. Your endpoint must accept JSON and reply with HTTP 200.
{
"twinr_product_id": "TWINR_PRODUCT_ID",
"store_product_id": "STORE_PRODUCT_ID",
"platform": "android or ios",
"transaction_id": "ENTITLEMENT_OR_TRANSACTION_ID",
"success": true,
"user_info": "USERNAME",
"revenuecat_data": {
"app_user_id": "REVENUECAT_APP_USER_ID",
"active_entitlements": {},
"all_purchased_product_ids": [],
"first_seen": "",
"original_purchase_date": "",
"management_url": ""
}
}
success is false when the purchase failed. user_info is the signed-in username, if the customer is signed in. The request also carries your website's cookies, so your server can tell who is buying.
The reply decides what the customer sees:
| Your reply | What the app does |
|---|---|
200 with {"load_url": "https://example.com/thanks"} |
Opens that URL in the app. |
200 with no load_url |
Shows a Purchase Successful message. |
| Any other status, or no reply | Shows Purchase Failed. |
When a customer restores purchases, the app posts to the same URL with "action": "restore" and no product fields.
How It Works
- User initiates purchase in the app.
- Store processes payment.
- RevenueCat validates the receipt.
- RevenueCat updates subscription status.
- Twinr unlocks the entitlement for the user.
All lifecycle events such as renewals, cancellations, and expirations are handled automatically.
Testing RevenueCat Integration
Before going live:
- Use sandbox test accounts.
- Verify entitlement activation.
- Test subscription renewal.
- Test cancellation behavior.
- Confirm subscription expiration flow.
Important Notes
- Products must match exactly between:
- Store
- RevenueCat
- The offering must be marked as Current
- Always test in sandbox mode before production release
- RevenueCat integration is available on the Standard plan and above