Skip to main content
Question

Paywall is popping up again after a purchase is complete before.

  • June 16, 2024
  • 1 reply
  • 92 views

Forum|alt.badge.img+2

A succeed purchase is complete, but when I re-launch the app again, the paywall page is displayed again. How to avoid it, meaning to check if a user already purchased before then if yes not pop up the paywall.

```

            .sheet(isPresented: $showPaywall) {

                MyPaywallView()

            }

```

 

```

import SwiftUI

import RevenueCat

import RevenueCatUI

 

struct MyPaywallView: View {

    var body: some View {

        PaywallView()

    }

}

 

#Preview {

    MyPaywallView()

}

```

This post has been closed for comments

1 reply

joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 313 replies
  • June 20, 2024

Hi there,

If you are using RevenueCat paywalls, you can just use the view modifier `presentPaywallIfNeeded` and the paywall will only be presented when the user is not subscribed yet. You can find the info here

 

If you want to manually check if a user is subscribed or not, you can always check the customer info.

Something along the following lines:

```

 

if customerInfo.entitlements[<your_entitlement_id>]?.isActive == true {
// user has access to "your_entitlement_id"
}

```

Best,


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings