Skip to content

Commit

Permalink
Document how to dynamically show product tiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed Oct 23, 2024
1 parent 94bec58 commit 06f3fec
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Sources/FreemiumKit/FreemiumKit.docc/SetupGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,21 @@ struct MyApp: App {
}
```
## Dynamically Showing Product Tiers
You can customize which product tiers are shown in the paywall using the `showTierInPaywall` closure. This is particularly useful when you have multiple product tiers and want to conditionally display or hide certain tiers based on dynamic logic, such as a user's app usage or behavior.
To configure this behavior, simply assign a closure to `FreemiumKit.shared.showTierInPaywall`. The closure takes the tier number as an input and needs to return `true` if the tier should be displayed or `false` if it should be hidden. Here's an example of how to hide a specific tier, call this right on app start:
```swift
FreemiumKit.shared.showTierInPaywall = { tier in
return tier != 3 // hide tier 3, but show all others
}
```
This allows you to tailor the product options presented to your users, improving their experience based on their specific circumstances.
[🏠 Back to Home](https://freemiumkit.app)
## Contact
Expand Down

0 comments on commit 06f3fec

Please sign in to comment.