Skip to content

Show DefaultPaywall warning view in UI preview mode#6973

Merged
ajpallares merged 4 commits into
mainfrom
pallares/show-default-paywall-warning-in-ui-preview-mode
Jun 12, 2026
Merged

Show DefaultPaywall warning view in UI preview mode#6973
ajpallares merged 4 commits into
mainfrom
pallares/show-default-paywall-warning-in-ui-preview-mode

Conversation

@ajpallares

@ajpallares ajpallares commented Jun 11, 2026

Copy link
Copy Markdown
Member

Motivation

DefaultPaywallView shows configuration warnings only in DEBUG. The RevenueCat mobile app's UI preview mode runs in release configuration, so those warnings never appear for developer, and they may help them debug the issue more easily. This change surfaces them in UI preview mode.

Description

  • Adds @_spi(Internal) Purchases.isUIPreviewMode and threads it through PaywallPurchasesType / PurchaseHandler.
  • shouldShowWarning returns true in UI preview mode when a warning exists, even outside DEBUG.
image

Note

Low Risk
UI-only gating for developer warnings with no purchase or auth changes; release behavior unchanged unless UI preview mode is explicitly configured.

Overview
Default paywall configuration warnings now appear in UI preview mode on release builds, not only in DEBUG.

The PR adds @_spi(Internal) Purchases.isUIPreviewMode (from DangerousSettings.uiPreviewMode) and threads it through PaywallPurchasesType, PurchaseHandler, and test/stub implementations (MockPurchases, NotConfiguredPurchases, LoadingPaywallPurchases).

DefaultPaywallView.shouldShowWarning still shows warnings whenever one exists in DEBUG; in release it only shows when both a warning is present and handler.isUIPreviewMode is true, so production users do not see developer-facing warnings.

Reviewed by Cursor Bugbot for commit 2b261a6. Bugbot is set up for automated code reviews on this repo. Configure here.

DefaultPaywallView configuration warnings stay DEBUG-only unless DangerousSettings.uiPreviewMode is enabled, so the RevenueCat app can surface them in release UI preview builds.

Co-authored-by: Cursor <cursoragent@cursor.com>
ajpallares and others added 3 commits June 11, 2026 10:20
Co-authored-by: Cursor <cursoragent@cursor.com>
…e' of github.com:RevenueCat/purchases-ios into pallares/show-default-paywall-warning-in-ui-preview-mode
@ajpallares ajpallares marked this pull request as ready for review June 11, 2026 08:33
@ajpallares ajpallares requested review from a team as code owners June 11, 2026 08:33
@ajpallares ajpallares requested a review from a team June 11, 2026 08:33

@rickvdl rickvdl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes total sense to me, thanks for adding!

@ajpallares ajpallares merged commit 9aae18a into main Jun 12, 2026
18 of 20 checks passed
@ajpallares ajpallares deleted the pallares/show-default-paywall-warning-in-ui-preview-mode branch June 12, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants