Hey everyone!
I'm using RevenueCat’s default PaywallView
in my iOS app, and I’d like to know if there’s a supported way to run a custom validation before the actual purchase happens, using the default paywall UI.
Here’s the use case I need to support:
-
A user logs in to App Account A using Apple ID X, then subscribes successfully.
-
Later, they log out and log in with App Account B, but still using the same Apple ID X.
-
Before allowing them to subscribe again, I want to detect that Apple ID X already has a subscription tied to a different app user ID.
To do this, I use restorePurchases()
and compare the originalAppUserId
.
But currently, I can only run this validation before presenting the paywall, which isn’t ideal UX-wise.
I saw that originalTemplatePaywallFooter
accepts a purchaseStarted
callback, like:
CustomMarketingView().originalTemplatePaywallFooter(purchaseStarted: <PurchaseOfPackageStartedHandler?>)
But i can't make it work.
❓What I’d really like:
To trigger my validation only when the user taps "Subscribe", inside the default PaywallView
, and prevent the purchase if the validation fails (e.g., by showing an alert instead).
Is there a way to hook into that flow without fully replacing the default paywall UI?
Thanks in advance!