Skip to main content

Adding Promo Code Support in FlutterFlow with RevenueCat

Tom avatar
Written by Tom
Updated over a month ago

Implementing promo codes using RevenueCat in FlutterFlow is absolutely possible. It’s a bit tricky due to the differing ways Google Play and iOS handle promo and subscription offers.

According to RevenueCat’s docs:

  • Google Play promo codes allow free trials only and cannot offer direct discount pricing, and are only redeemable via the in‑app purchase flow. Custom promo codes (multiple‑use) can’t offer variable pricing beyond trial length

  • iOS Subscription Offers (Promotional Offers and Offer Codes) must be set up in App Store Connect, require a subscription key in RevenueCat, and have unstable redemption methods (e.g. presentCodeRedemptionSheet is janky)

Given this fragmentation, many devs recommend building a custom promo code workflow instead of relying on native store promo tools.


🛠 Step 1: Create Promo Products in App Store & Google Play

  • In both app stores, create promo‑specific SKUs (e.g. discounted price, extended trial).

  • Import those SKUs into RevenueCat so they appear under offerings.

📦 Step 2: Define a Promo Package in RevenueCat

  • In your RevenueCat dashboard, create an Offering and add a package for the promo product.

  • Give it a customID (e.g. weeklyPromo) for FlutterFlow to reference.

🔐 Step 3: Manage Promo Codes & Validation Logic

  • Ideally, implement a secure backend to validate promo codes and prevent abuse.

  • For this demo, you can simulate via FlutterFlow’s page state:

    • Provide a TextField for user entry.

    • On button tap, call your backend to validate the code.

    • If valid, set pageState.isPromoValid = true.

(Note: Keeping this logic on the backend is essential in production.)

🛒 Step 4: Trigger the Appropriate Purchase

  • In FlutterFlow, use an IF condition on isPromoValid:

    • If true → use RevenueCat’s Purchase Package action to purchase the promo package.

    • Else → purchase the standard package.

  • This lets you switch the purchase flow dynamically based on the promo code input.

Did this answer your question?