RevenueCat Integration for Subscription Management
RevenueCat solves a specific problem: synchronize subscription status across iOS, Android, and backend without writing your own receipt validation server. Instead of dealing with Apple Server Notifications v2 and Google Play RTDN yourself, you get a unified CustomerInfo object with current status.
What happens under the hood
RevenueCat SDK wraps native StoreKit (iOS) and Google Play Billing (Android). On purchase, the SDK sends receipt/purchaseToken to RevenueCat servers, which verify with Apple/Google and return normalized status. RevenueCat stores the history of all transactions — this allows restoring access on new devices without calling native restore.
Integration
// iOS — AppDelegate or @main
Purchases.configure(
with: Configuration.Builder(withAPIKey: "appl_xxxxx")
.with(appUserID: currentUser.id) // nil = anonymous
.build()
)
// Purchase through RevenueCat
let (transaction, customerInfo, error) = await Purchases.shared
.purchase(package: package)
if customerInfo?.entitlements["premium"]?.isActive == true {
unlockPremium()
}
Key concept — entitlements. In the RevenueCat dashboard, create entitlement premium, bind all products to it (monthly subscription, annual, lifetime). In code, check only the entitlement, not the specific product ID. When adding a new pricing plan — just add the product to the entitlement in the dashboard, code doesn't change.
Cross-platform synchronization
If a user bought a subscription on iOS and opens the Android version — pass the same appUserID when configuring the SDK on both platforms. RevenueCat returns CustomerInfo with active entitlement regardless of the platform of purchase. This only works if the user is authenticated in the app — for anonymous RevenueCat generates $RCAnonymousID, which is not transferred between devices automatically.
Webhooks and server synchronization
RevenueCat sends webhooks on any subscription status change: INITIAL_PURCHASE, RENEWAL, CANCELLATION, EXPIRATION, BILLING_ISSUE. This is a full replacement for Apple Server Notifications + Google RTDN in one interface. Configured in Project Settings → Integrations.
For backend — one endpoint instead of two (Apple + Google), unified payload format. Saves 2–3 days of server development.
Limitations
RevenueCat takes 1% of revenue after $2500/month. For most applications this is acceptable in exchange for saved time. But at scale $100k+/month — calculate, it might be cheaper to build your own.
Integration time — 2–3 days: SDK installation, product and entitlement setup in dashboard, integration into existing authentication flow, testing in Sandbox/Test environment.







