Skip to main content
Question

SwiftUI Paywall sheet doesn't dismiss automatically after successful purchase

  • September 4, 2025
  • 2 replies
  • 50 views

Forum|alt.badge.img
import SwiftUI
import RevenueCat
import RevenueCatUI

struct BuyPremiumInfoOrButton: View {

@EnvironmentObject var store: Store

@State private var displayPaywall = false

var body: some View {
Group {
switch store.premiumState {
case .notLoaded:
Text("Loading...")
case .hasPremium:
Label("You have premium", systemImage: "crown")
case .doesNotHavePremium:
Button {
displayPaywall.toggle()
} label: {
Label("Upgrade to Premium", systemImage: "crown")
}
case .error:
Text("There was an error loading your premium status")
}
}.sheet(isPresented: self.$displayPaywall, onDismiss: {
store.refresh()
}) {
PaywallView()
}
}
}

The above is my code. Its just using the PaywallView() from the RevenueCatUI. But this one seems to not dismiss the sheet that the paywall is in automatically after a purchase. So it seems like the PaywallView is not calling the environment dismiss after a purchase.
Does anybody know what the issue is?
My RevenueCat SDK version is 5.35.1

 

This post has been closed for comments

2 replies

Forum|alt.badge.img
  • Author
  • New Member
  • September 4, 2025

Maybe the solution is to do this:

            PaywallView(displayCloseButton: true)
.onRequestedDismissal {
displayPaywall = false
}

 


Forum|alt.badge.img+8
  • RevenueCat Staff
  • September 10, 2025

Hi ​@isaakh our paywalls should be automatically dismiss after a purchase, could you please open a support ticket here or DM me full RevenueCat debug logs with log level verbose that reproduce this, see our docs here for how to enable these?