I have a Standard and Premium plan. If a user is sub’d to the Standard plan, how can I show the Standard plan as active and current without the purchase button? I want the user to see all plans, including their current plan. I’m trying to avoid hard-coding a current plan screen in the app.
Solved
Disable Purchase for current plan
Best answer by James Grote
Here is my SwiftUI solution. I’m using a TabView to show each available offering (e.g. Standard and Premium), and if the user has one of these offerings, I simply disable that tab and show an offering_copy that shows “Current Offering” text.
TabView(selection: $currentTab) {
PaywallView(offering: offering1, displayCloseButton: entitlement != entitlement_content).tag(0)
.disabled(entitlement == entitlement_content)
.tabItem {
Label("Standard", systemImage: "star.fill")
}
PaywallView(offering: offering2, displayCloseButton: entitlement != entitlement_content_plus).tag(1)
.disabled(entitlement == entitlement_content_plus)
.tabItem {
Label("Premium", systemImage: "crown.fill")
}
This works for now.
Hope for something better in the future. Again, the requirement is to show all possible offerings, including the active one which is disabled. Like the CustomerCenter but with actual paywalls.
This post has been closed for comments
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.