How to add RevenueCat to your iOS app
What RevenueCat does for an iOS app
When you sell a subscription on iOS, Apple processes the payment through StoreKit, but you still have to verify purchases, track who has access, handle restores across devices, and report revenue. RevenueCat does that for you behind one SDK call. You define products and entitlements in its dashboard, and your app just asks "does this user have Pro?"
Adding RevenueCat with AppFlight
In AppFlight you open the integrations panel, choose RevenueCat, and paste your public app-specific key (it starts with appl_). AppFlight stores it as a client key, which is safe to ship, and never lets a secret key into the app binary. From there you can ask the AI to add a paywall and gate features behind an entitlement, and it generates the SwiftUI for you.
A SwiftUI example
Configure the SDK once at launch, then check entitlements where you gate a feature:
import RevenueCat
import SwiftUI
@main
struct MyApp: App {
init() {
Purchases.configure(withAPIKey: "appl_YourPublicKey")
}
var body: some Scene {
WindowGroup { ContentView() }
}
}
func hasPro() async -> Bool {
let info = try? await Purchases.shared.customerInfo()
return info?.entitlements["pro"]?.isActive == true
}
Common mistakes
- Shipping a secret key. The iOS SDK only needs the public key that starts with
appl_. A secretsk_key must never enter the app binary. - Forgetting restores. Apple requires a working restore path, and reviewers test it. RevenueCat gives you
restorePurchases()so testers are never stuck on a paywall. - Gating on the wrong signal. Check the entitlement (
info.entitlements["pro"]?.isActive), not a raw product identifier, so a plan or price change does not silently break access.
Alternatives
There is no single right answer here. The honest way to choose is by what you actually need to ship.
| Tool | Best for | Watch out for |
|---|---|---|
| RevenueCat | Cross-platform entitlements, receipt validation, and revenue analytics without building them yourself | A dashboard to configure; more than a single simple product needs |
| StoreKit 2 | A solo iOS app with one or two simple products | You build restores, entitlement logic, and analytics yourself |
| Superwall | Designing and A/B testing paywalls remotely without shipping an app update | Pair it with RevenueCat or StoreKit for the actual entitlement check |
| Stripe | Payments outside Apple in-app purchase, like physical goods or services | Apple restricts it for digital goods; read guideline 3.1.1 first |
Superwall pairs well with RevenueCat when you want to design and test paywalls remotely. StoreKit 2 on its own is a fine choice for a simple single-product app. Stripe is for payments outside Apple's in-app purchase system, which Apple restricts for digital goods, so read the guidelines before choosing it for in-app content.
FAQ
Is RevenueCat free?
RevenueCat has a free tier that covers a meaningful amount of monthly tracked revenue, then moves to usage-based pricing. Check their current pricing page for thresholds.
Do I paste a secret key into my app?
No. The iOS SDK uses a public app-specific key that starts with appl_, which is safe to ship in the binary. Never put a secret key (sk_) in the app. AppFlight classifies keys as client or backend so the wrong one never ships.
RevenueCat or StoreKit directly?
StoreKit 2 is capable on its own. RevenueCat is worth it when you want cross-platform entitlements, server-side receipt validation, and analytics without building that yourself. For a solo iOS app with simple products, StoreKit 2 alone can be enough.