From 3e2d802b0a86405b5839a273bc5c12909c9b6fa0 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 22 Jun 2026 10:47:22 +0000 Subject: [PATCH] Align Android paywall preview mocks with web/dashboard catalog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The validation-screenshot preview parser used Android-specific prices and an inconsistent set of trial/intro offers, so the rendering-validation screenshots showed different products/prices/offers than the web and dashboard renders. Update the preview product table to the canonical web/dashboard prices and periods (weekly $2.99 … annual $69.99, lifetime $119.99), give every subscription the same single $1.99 / 1-week introductory offer, and use 'Pro Access' as the store product name to match the web/dashboard tables. This is preview-only data used by Compose @Preview and the Paparazzi validation recorder; no purchasing logic changes. Co-authored-by: joop --- .../purchases/utils/PreviewOfferingParser.kt | 80 ++++++++----------- 1 file changed, 33 insertions(+), 47 deletions(-) diff --git a/purchases/src/main/kotlin/com/revenuecat/purchases/utils/PreviewOfferingParser.kt b/purchases/src/main/kotlin/com/revenuecat/purchases/utils/PreviewOfferingParser.kt index f0876ae19f..c08bf5b304 100644 --- a/purchases/src/main/kotlin/com/revenuecat/purchases/utils/PreviewOfferingParser.kt +++ b/purchases/src/main/kotlin/com/revenuecat/purchases/utils/PreviewOfferingParser.kt @@ -24,104 +24,90 @@ private class PreviewOfferingParser : OfferingParser() { val identifier = packageJson.getString("identifier") val packageType = PackageType.values().first { packageType -> packageType.identifier == identifier } - // These products are the same as those in TestData in revenuecatui. + // Prices, periods, and the single introductory offer ($1.99 for 1 week) are kept in + // sync with the web/dashboard preview variable tables so the paywall rendering-validation + // screenshots show the same products, prices, and offers across platforms. (This + // intentionally diverges from TestData in revenuecatui, which is used for other previews.) return when (packageType) { PackageType.LIFETIME -> TestStoreProduct( id = "com.revenuecat.lifetime_product", - name = "Lifetime", + name = "Pro Access", title = "Lifetime (App name)", - price = Price(amountMicros = 1_000_000_000, currencyCode = "USD", formatted = "$ 1,000.00"), + price = Price(amountMicros = 119_990_000, currencyCode = "USD", formatted = "$119.99"), description = "Lifetime", period = null, ) PackageType.ANNUAL -> TestStoreProduct( id = "com.revenuecat.annual_product", - name = "Annual", + name = "Pro Access", title = "Annual (App name)", - price = Price(amountMicros = 67_990_000, currencyCode = "USD", formatted = "$ 67.99"), + price = Price(amountMicros = 69_990_000, currencyCode = "USD", formatted = "$69.99"), description = "Annual", period = Period(value = 1, unit = Period.Unit.YEAR, iso8601 = "P1Y"), - freeTrialPricingPhase = PricingPhase( - billingPeriod = Period(value = 1, unit = Period.Unit.MONTH, iso8601 = "P1M"), - recurrenceMode = RecurrenceMode.FINITE_RECURRING, - billingCycleCount = 1, - price = Price( - amountMicros = 0L, - currencyCode = "USD", - formatted = "Free", - ), - ), + introPricePricingPhase = introductoryOfferPhase(), ) PackageType.SIX_MONTH -> TestStoreProduct( id = "com.revenuecat.semester_product", - name = "6 month", + name = "Pro Access", title = "6 month (App name)", - price = Price(amountMicros = 39_990_000, currencyCode = "USD", formatted = "$ 39.99"), + price = Price(amountMicros = 39_990_000, currencyCode = "USD", formatted = "$39.99"), description = "6 month", period = Period(value = 6, unit = Period.Unit.MONTH, iso8601 = "P6M"), + introPricePricingPhase = introductoryOfferPhase(), ) PackageType.THREE_MONTH -> TestStoreProduct( id = "com.revenuecat.quarterly_product", - name = "3 month", + name = "Pro Access", title = "3 month (App name)", - price = Price(amountMicros = 23_990_000, currencyCode = "USD", formatted = "$ 23.99"), + price = Price(amountMicros = 24_990_000, currencyCode = "USD", formatted = "$24.99"), description = "3 month", period = Period(value = 3, unit = Period.Unit.MONTH, iso8601 = "P3M"), - freeTrialPricingPhase = PricingPhase( - billingPeriod = Period(value = 2, unit = Period.Unit.WEEK, iso8601 = "P2W"), - recurrenceMode = RecurrenceMode.FINITE_RECURRING, - billingCycleCount = 1, - price = Price( - amountMicros = 0L, - currencyCode = "USD", - formatted = "Free", - ), - ), - introPricePricingPhase = PricingPhase( - billingPeriod = Period(value = 1, unit = Period.Unit.MONTH, iso8601 = "P1M"), - recurrenceMode = RecurrenceMode.FINITE_RECURRING, - billingCycleCount = 1, - price = Price(amountMicros = 3_990_000, currencyCode = "USD", formatted = "$ 3.99"), - ), + introPricePricingPhase = introductoryOfferPhase(), ) PackageType.TWO_MONTH -> TestStoreProduct( id = "com.revenuecat.bimonthly_product", - name = "2 month", + name = "Pro Access", title = "2 month (App name)", - price = Price(amountMicros = 15_990_000, currencyCode = "USD", formatted = "$ 15.99"), + price = Price(amountMicros = 17_990_000, currencyCode = "USD", formatted = "$17.99"), description = "2 month", period = Period(value = 2, unit = Period.Unit.MONTH, iso8601 = "P2M"), - introPricePricingPhase = PricingPhase( - billingPeriod = Period(value = 1, unit = Period.Unit.MONTH, iso8601 = "P1M"), - recurrenceMode = RecurrenceMode.FINITE_RECURRING, - billingCycleCount = 1, - price = Price(amountMicros = 3_990_000, currencyCode = "USD", formatted = "$ 3.99"), - ), + introPricePricingPhase = introductoryOfferPhase(), ) PackageType.MONTHLY -> TestStoreProduct( id = "com.revenuecat.monthly_product", - name = "Monthly", + name = "Pro Access", title = "Monthly (App name)", - price = Price(amountMicros = 7_990_000, currencyCode = "USD", formatted = "$ 7.99"), + price = Price(amountMicros = 9_990_000, currencyCode = "USD", formatted = "$9.99"), description = "Monthly", period = Period(value = 1, unit = Period.Unit.MONTH, iso8601 = "P1M"), + introPricePricingPhase = introductoryOfferPhase(), ) PackageType.WEEKLY -> TestStoreProduct( id = "com.revenuecat.weekly_product", - name = "Weekly", + name = "Pro Access", title = "Weekly (App name)", - price = Price(amountMicros = 1_490_000, currencyCode = "USD", formatted = "$ 1.49"), + price = Price(amountMicros = 2_990_000, currencyCode = "USD", formatted = "$2.99"), description = "Weekly", period = Period(value = 1, unit = Period.Unit.WEEK, iso8601 = "P1W"), + introPricePricingPhase = introductoryOfferPhase(), ) else -> null } } + + // A single introductory offer of $1.99 for 1 week, attached to every subscription, matching + // the offer values in the web/dashboard preview tables and the iOS preview harness. + private fun introductoryOfferPhase(): PricingPhase = PricingPhase( + billingPeriod = Period(value = 1, unit = Period.Unit.WEEK, iso8601 = "P1W"), + recurrenceMode = RecurrenceMode.FINITE_RECURRING, + billingCycleCount = 1, + price = Price(amountMicros = 1_990_000, currencyCode = "USD", formatted = "$1.99"), + ) }