May 7, 2025
Unified SDK Setup: One initialization supports both iOS and Android purchase systems.
Offerings Model: Group SKUs for flexible pricing, A/B tests, and remote config without app updates.
Entitlement Tracking: Listen to entitlement changes globally for access control and UI updates.
Restore Support: Enable restorePurchases for account recovery across platforms.
Error Handling: Gracefully manage pending transactions and invalid SKUs.
Analytics Built-In: Use RevenueCat’s dashboard for revenue insights and churn monitoring.
Introduction
Implementing in-app purchases in Flutter can be complex, but integrating RevenueCat streamlines subscription management, cross-platform receipt validation, and analytics. RevenueCat’s Flutter SDK wraps the StoreKit and Billing APIs, handling entitlements, promotions, and restore flows for you. In this tutorial, you’ll learn how to set up RevenueCat for Flutter, fetch products, make in-app purchases, and handle entitlement updates.
Configuring RevenueCat SDK
Add the dependency in
pubspec.yaml
:
Initialize RevenueCat in your
main.dart
beforerunApp()
:
Replace "public_sdk_key" with your RevenueCat API key from the dashboard. This single call handles observer registration for both iOS and Android.
Enable in-app purchases in Xcode (App Store Connect) and Google Play Console. Define consumable, non-consumable, or subscription products there, matching identifiers in RevenueCat.
Fetching Products and Enabling Purchases
After initialization, retrieve product offerings configured in the RevenueCat dashboard. Offerings let you group different SKUs under identifiers (e.g., "monthly", "yearly").
In your UI layer:
This code fetches your configured offerings and launches a purchase flow when the user taps a button.
Listening to Entitlements and Restoring Purchases
RevenueCat emits entitlement updates whenever a purchase or restore succeeds. You can listen globally:
Call EntitlementManager() early in your app lifecycle (e.g., in a provider or state management init). Expose restorePurchases() in your settings or purchase screen to let users recover purchases.
Best Practices and Edge Cases
• Validate SKU identifiers in RevenueCat against those in your store consoles.
• Use Offerings for A/B tests or region-specific pricing without code changes.
• Handle PurchasePendingError if the transaction requires external approval (e.g., family sharing).
• Monitor revenue and cancellation metrics directly in RevenueCat’s dashboard.
Vibe Studio

Vibe Studio, powered by Steve’s advanced AI agents, is a revolutionary no-code, conversational platform that empowers users to quickly and efficiently create full-stack Flutter applications integrated seamlessly with Firebase backend services. Ideal for solo founders, startups, and agile engineering teams, Vibe Studio allows users to visually manage and deploy Flutter apps, greatly accelerating the development process. The intuitive conversational interface simplifies complex development tasks, making app creation accessible even for non-coders.
Conclusion
With RevenueCat integrated, your Flutter app’s in-app purchase life cycle—from product display to receipt validation and restoration—is abstracted into a few lines of code. You no longer manage platform-specific boilerplate or server-side receipt verification manually. Now you’re equipped to implement in-app purchases, subscriptions, and entitlements in your Flutter projects with confidence. Happy coding!