Claude Cursor Skill

revenuecat-testing

Use when testing RevenueCat purchases/subscriptions, setting up sandbox testing, debugging a purchase/restore/trial, verifying entitlements or events, or writing an IAP QA plan.

LLM Mart · 0 points · 15 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download evanca-flutter-ai-rules-skills_revenuecat-testing-7d226d8.zip · 5 KB
Part of evanca/flutter-ai-rules — 37 skills

Install

skills CLI npx skills add https://github.com/evanca/flutter-ai-rules/tree/main/skills/revenuecat-testing
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install evanca-flutter-ai-rules@llmmart
Git git clone https://github.com/evanca/flutter-ai-rules.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole evanca/flutter-ai-rules collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

RevenueCat Testing

Help a developer systematically verify their RevenueCat integration works before shipping — turning "I added RevenueCat, does it actually work?" into a concrete, checkable QA plan. The full use-case matrix, methods, platform differences, and the verifiable signal for each case live in references/use_cases.md. Read it for exact event names and preconditions; this file is the operating guide.

The organizing principle: every RevenueCat behavior has a verifiable signal — a specific dashboard event (INITIAL_PURCHASE, TRANSFER, EXPIRATION, PRODUCT_CHANGE, CANCELLATION), a period_type value, or a CustomerInfo/debug-log state. A test isn't "did the app not crash"; it's "did the expected event appear in the customer's history with the right fields." Always tie a test to its signal, or it isn't really testing anything.

How to use this skill

  1. Get the setup facts: platform(s) (iOS / Android / cross-platform / web billing), SDK (native, RN, Flutter, etc.), whether they've enabled debug logs and sandbox accounts yet, and what specifically they're trying to verify or why they think something is broken.
  2. Establish prerequisites first — most "purchases don't work" reports are config problems visible before any purchase:
    • Debug logs on before configure() (iOS Purchases.logLevel = .debug; Android setLogLevel(LogLevel.DEBUG)), and check for "Invalid Product Identifiers" and error-level logs. Fix those before touching purchase flows.
    • Sandbox environment set up; multiple sandbox test IDs ready if any account-switching is in scope.
    • Point them at the debug overlay (debugRevenueCatOverlay() / DebugRevenueCatBottomSheet) to preview offerings and run test purchases quickly.
  3. Map their goal to use cases from the reference and produce the plan (below).

Reference implementation (especially for Flutter): RevenueCat ships an official Purchase Tester sample app at github.com/RevenueCat/purchases-flutter/tree/main/revenuecat_examples/purchase_tester. It's a runnable app exercising the flows this skill tests — dedicated screens for product change (product_change_testing_screen.dart), paywalls and paywall-footer, customer center, virtual currency, winback offers, and custom paywall-impression testing — plus an end-to-end integration test at integration_test/app_test.dart. Point Flutter users there to (a) run a known-good build to isolate whether a bug is in their code vs. their store/RevenueCat config, and (b) model their own integration_test widget tests on app_test.dart. For non-Flutter SDKs, RevenueCat has equivalent Purchase Tester apps in each SDK repo.

The five testing domains

Pull the specific rows from references/use_cases.md; here's the shape so you know what to cover:

  1. Subscription lifecycle — purchase, free trial/intro offer (period_type = TRIAL/INTRO), renewal, upgrade/downgrade (PRODUCT_CHANGE), cancellation, expiration, refund. Platform gotcha to always flag: iOS sandbox refunds are not possible — the App Store routes users to Apple support and the CANCELLATION/CUSTOMER_SUPPORT event can take ~24h; Google Play refunds are dashboard-driven.
  2. Configuration — anonymous vs identified App User IDs (verify via debug log + CustomerInfo), offering display, and login/logout — where the key risk is unintended data merging between accounts.
  3. Restoring flow — the account-switching/transfer matrix. This is the highest-value, most-bug-prone area: syncPurchases(), restore-to-new-ID, the three-ID conflict case (transfer succeeds for the empty ID, errors for the one that already owns the sub), and transfer-disabled behavior. The signal throughout is whether a TRANSFER event fires (or correctly does not).
  4. Paywalls — display & purchase, localization (device/store-account country → language + localized price), and intro-offer eligibility display for fresh users.
  5. RevenueCat Billing (web) — purchase, trial auto-conversion, expiration.

Deliverables

  • QA test plan — a checklist of the use cases relevant to their app (skip web billing if they're mobile-only, skip trials if they have none), each row as: action → expected event/signal → where to see it. This is the primary output; make it copy-pasteable into a QA doc or issue tracker.
  • Debugging a specific failure — diagnose against the reference: is it a prereq problem (invalid product IDs, logs off, wrong sandbox account)? a wrong-signal expectation (e.g. expecting TRANSFER when transfer is disabled)? a platform difference (iOS refund can't be sandbox-tested)? Name the expected event and where it should appear, then work backward from what they actually see.
  • Restore/transfer walkthrough — when the user is confused about account switching, walk the specific ID configuration and the expected TRANSFER-or-error outcome for each ID, since this is the area the docs spend the most care on.
  • Sandbox setup guidance — the prerequisites section, adapted to their platform and SDK.

Tie every recommendation to the verifiable signal in references/use_cases.md — the event cheat-sheet at the bottom of that file maps each event to what it proves.

Files (flutter-ai-rules)
  • references
    • use_cases.md 5.1 KB
      # RevenueCat testing use cases
      
      Source: revenuecat.com/docs/guides/testing-guide/use-cases and /docs/test-and-launch/debugging (compiled 2026-07). Every use case below lists the method and the **verifiable signal** — the dashboard event or CustomerInfo/log state that proves it worked. Cross-reference all events in the RevenueCat customer history; some (like iOS refunds) can take up to 24 hours.
      
      ## Prerequisites (do first, every platform)
      
      - **Enable debug logs before `configure()`**: iOS/macOS `Purchases.logLevel = .debug`; Android `Purchases.setLogLevel(LogLevel.DEBUG)`; RN/Flutter set log level before configure. (iOS: disabling `OS_ACTIVITY_MODE` in the Xcode scheme blocks debug logs from printing.)
      - **Watch logs for "Invalid Product Identifiers"** and any error-level messages *before* attempting sandbox purchases — fix product config first.
      - **Debug overlay** to preview offerings/packages/products and run test purchases: iOS 4.22.0+ `.debugRevenueCatOverlay()` (SwiftUI) / `presentDebugRevenueCatOverlay()` (UIKit); Android 6.9.2+ `DebugRevenueCatBottomSheet`.
      - **Sandbox environment** is required for all tests except iOS refund verification. Use **multiple sandbox test IDs** for account-switching/transfer scenarios.
      
      ## 1. Subscription lifecycle
      
      | Use case | Method | Verify |
      |---|---|---|
      | Purchase flow | Buy in sandbox | Purchase event with correct App User ID on overview |
      | Free trials & intro offers | Fresh sandbox user, buy product with offer attached | Purchase event `period_type` = `TRIAL` or `INTRO` |
      | Cancellation | Cancel via device settings, or RevenueCat API (Google Play) | `CANCELLATION` event in customer history immediately |
      | Expiration | Let billing cycle end | `EXPIRATION` event at expiry timestamp; entitlement/content access revoked |
      | Upgrades/downgrades | Change tier within a subscription group | `PRODUCT_CHANGE` event with correct old + new product IDs |
      | Refund handling | Google Play: refund from dashboard. **iOS: sandbox refunds not possible** — App Store directs users to Apple support | `CANCELLATION` event, reason `CUSTOMER_SUPPORT`, appears after ~24h; app degrades gracefully |
      | Google offers | SDK auto-applies longest free trial / cheapest intro; manual via `subscriptionOptions` | Correct offer applies at purchase; offers tagged `rc-ignore-offer` are NOT auto-selected |
      
      **Platform notes:** Google Play uses `PRORATION` modes for tier changes; iOS follows Apple's upgrade/downgrade timing.
      
      ## 2. Configuration
      
      | Use case | Method | Verify |
      |---|---|---|
      | Anonymous App User ID | `configure()` with no appUserID | Log `Initial App User ID - $RCAnonymousID:[hash]`; CustomerInfo shows anonymous ID |
      | Identified App User ID | `configure(appUserID:)` | Log shows custom ID; CustomerInfo shows it as Original App User ID |
      | Display offering flow | Fetch current offerings / by placement / custom by ID | Offerings render; packages grouped by type (monthly, annual, …) |
      | Login/logout flow | configure → logIn(custom ID) → logOut → logIn(different ID) | CustomerInfo updates correctly; **no unintended data merging** between accounts |
      
      ## 3. Restoring flow (the account-switching matrix — the trickiest area)
      
      | Use case | Precondition | Verify |
      |---|---|---|
      | `syncPurchases()` across accounts | ID#1 has active sub, ID#2 has none | ID#2 gains access; `TRANSFER` event in history |
      | Restore purchases (transfer to new ID) | Access paid on ID#1 → log out → new ID → tap Restore | New ID gets access without repurchase; `TRANSFER` event |
      | Restore with no active subs / conflict | ID#1 has sub, ID#2 none, ID#3 same sub | ID#2 gets transfer; ID#3 gets an error and **no** `TRANSFER` |
      | Keep with original ID (transfer disabled) | Log in with a different ID from the same store account | Error message; **no** `TRANSFER`; purchases stay on original ID |
      | Share between IDs (legacy aliasing) | — | Both IDs merge in history; ID#2 gains ID#1's entitlements |
      
      ## 4. Paywalls
      
      | Use case | Setup | Verify |
      |---|---|---|
      | Display & purchase | Show paywall | Correct packages render fullscreen; purchase event in history |
      | Localization | Set device/store account to target country | Correct language + localized pricing |
      | Intro offer eligibility display | Fresh (eligible) user | Paywall shows intro offer; `INITIAL_PURCHASE` event includes offer details |
      
      ## 5. RevenueCat Billing (Web)
      
      | Use case | Verify |
      |---|---|
      | Purchase flow | `INITIAL_PURCHASE` event on completion; entitlements grant access immediately |
      | Free trials | Trial applies per configured criteria; auto-converts to paid unless canceled |
      | Expiration | `EXPIRATION` event; access to protected content lost |
      
      ## Event cheat-sheet (what proves what)
      
      - `INITIAL_PURCHASE` — first purchase / web purchase / paywall intro purchase
      - `RENEWAL` — successful renewal
      - `PRODUCT_CHANGE` — upgrade/downgrade (carries old + new product IDs)
      - `CANCELLATION` — user canceled (reason `CUSTOMER_SUPPORT` = refund)
      - `EXPIRATION` — entitlement lapsed at cycle end
      - `TRANSFER` — purchases moved to another App User ID (the restore/sync signal)
      - `period_type` on a purchase — `TRIAL` / `INTRO` / `NORMAL`
      
  • SKILL.md 5.4 KB
    ---
    name: revenuecat-testing
    description: "Use when testing RevenueCat purchases/subscriptions, setting up sandbox testing, debugging a purchase/restore/trial, verifying entitlements or events, or writing an IAP QA plan."
    license: MIT
    ---
    
    # RevenueCat Testing
    
    Help a developer systematically verify their RevenueCat integration works before shipping — turning "I added RevenueCat, does it actually work?" into a concrete, checkable QA plan. The full use-case matrix, methods, platform differences, and the verifiable signal for each case live in `references/use_cases.md`. Read it for exact event names and preconditions; this file is the operating guide.
    
    **The organizing principle:** every RevenueCat behavior has a **verifiable signal** — a specific dashboard event (`INITIAL_PURCHASE`, `TRANSFER`, `EXPIRATION`, `PRODUCT_CHANGE`, `CANCELLATION`), a `period_type` value, or a CustomerInfo/debug-log state. A test isn't "did the app not crash"; it's "did the expected event appear in the customer's history with the right fields." Always tie a test to its signal, or it isn't really testing anything.
    
    ## How to use this skill
    
    1. **Get the setup facts**: platform(s) (iOS / Android / cross-platform / web billing), SDK (native, RN, Flutter, etc.), whether they've enabled debug logs and sandbox accounts yet, and what specifically they're trying to verify or why they think something is broken.
    2. **Establish prerequisites first** — most "purchases don't work" reports are config problems visible before any purchase:
       - Debug logs on *before* `configure()` (iOS `Purchases.logLevel = .debug`; Android `setLogLevel(LogLevel.DEBUG)`), and check for **"Invalid Product Identifiers"** and error-level logs. Fix those before touching purchase flows.
       - Sandbox environment set up; multiple sandbox test IDs ready if any account-switching is in scope.
       - Point them at the debug overlay (`debugRevenueCatOverlay()` / `DebugRevenueCatBottomSheet`) to preview offerings and run test purchases quickly.
    3. **Map their goal to use cases** from the reference and produce the plan (below).
    
    **Reference implementation (especially for Flutter):** RevenueCat ships an official **Purchase Tester** sample app at `github.com/RevenueCat/purchases-flutter/tree/main/revenuecat_examples/purchase_tester`. It's a runnable app exercising the flows this skill tests — dedicated screens for product change (`product_change_testing_screen.dart`), paywalls and paywall-footer, customer center, virtual currency, winback offers, and custom paywall-impression testing — plus an end-to-end integration test at `integration_test/app_test.dart`. Point Flutter users there to (a) run a known-good build to isolate whether a bug is in their code vs. their store/RevenueCat config, and (b) model their own `integration_test` widget tests on `app_test.dart`. For non-Flutter SDKs, RevenueCat has equivalent Purchase Tester apps in each SDK repo.
    
    ## The five testing domains
    
    Pull the specific rows from `references/use_cases.md`; here's the shape so you know what to cover:
    
    1. **Subscription lifecycle** — purchase, free trial/intro offer (`period_type` = `TRIAL`/`INTRO`), renewal, upgrade/downgrade (`PRODUCT_CHANGE`), cancellation, expiration, refund. **Platform gotcha to always flag:** iOS sandbox refunds are not possible — the App Store routes users to Apple support and the `CANCELLATION`/`CUSTOMER_SUPPORT` event can take ~24h; Google Play refunds are dashboard-driven.
    2. **Configuration** — anonymous vs identified App User IDs (verify via debug log + CustomerInfo), offering display, and login/logout — where the key risk is **unintended data merging** between accounts.
    3. **Restoring flow** — the account-switching/transfer matrix. This is the highest-value, most-bug-prone area: `syncPurchases()`, restore-to-new-ID, the three-ID conflict case (transfer succeeds for the empty ID, errors for the one that already owns the sub), and transfer-disabled behavior. The signal throughout is whether a `TRANSFER` event fires (or correctly does *not*).
    4. **Paywalls** — display & purchase, localization (device/store-account country → language + localized price), and intro-offer eligibility display for fresh users.
    5. **RevenueCat Billing (web)** — purchase, trial auto-conversion, expiration.
    
    ## Deliverables
    
    - **QA test plan** — a checklist of the use cases relevant to their app (skip web billing if they're mobile-only, skip trials if they have none), each row as: *action → expected event/signal → where to see it*. This is the primary output; make it copy-pasteable into a QA doc or issue tracker.
    - **Debugging a specific failure** — diagnose against the reference: is it a prereq problem (invalid product IDs, logs off, wrong sandbox account)? a wrong-signal expectation (e.g. expecting `TRANSFER` when transfer is disabled)? a platform difference (iOS refund can't be sandbox-tested)? Name the expected event and where it should appear, then work backward from what they actually see.
    - **Restore/transfer walkthrough** — when the user is confused about account switching, walk the specific ID configuration and the expected `TRANSFER`-or-error outcome for each ID, since this is the area the docs spend the most care on.
    - **Sandbox setup guidance** — the prerequisites section, adapted to their platform and SDK.
    
    Tie every recommendation to the verifiable signal in `references/use_cases.md` — the event cheat-sheet at the bottom of that file maps each event to what it proves.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related