Skip to main content
Question

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

  • 16 June 2024
  • 1 reply
  • 31 views

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

Userlevel 2
Badge +5

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,