// Automatic usage via AKConfig
@EnvironmentObject var config: AKConfig
// Paywall automatically shows when:
// 1. config.paywall = true
// 2. User taps premium feature without subscription
// Manual presentation
.sheet(isPresented: $showPaywall) {
AKPaywallSingleProductView()
.environmentObject(config)
}
// Features displayed:
// - Premium readings with AI
// - Unlimited insights
// - Daily tokens
// All localized automatically// Automatic usage
@EnvironmentObject var config: AKConfig
// Products are automatically loaded from RevenueCat
// User can select between options:
// - Weekly subscription
// - Monthly subscription
// - Yearly subscription (with discount)
// Trial toggle automatically filters products
// with/without introductory offers
.sheet(isPresented: $showPaywall) {
AKPaywallMultiProductView()
.environmentObject(config)
}AKFeatureRow(
icon: "sparkles",
title: "paywall.premium.readings",
subtitle: "paywall.premium.readings.subtitle"
)
AKFeatureRow(
icon: "infinity",
title: "paywall.unlimited.insights",
subtitle: "paywall.unlimited.insights.subtitle"
)
AKFeatureRow(
icon: "calendar",
title: "paywall.daily.tokens",
subtitle: "paywall.daily.tokens.subtitle"
)@State private var isTrialEnabled = true
ForEach(config.products, id: \.productIdentifier) { product in
AKSubscriptionOptionView(
isTrial: $isTrialEnabled,
product: product
)
.disabled(product == config.activeProduct)
}
// Automatically shows:
// - "First 7 days free, then $9.99/month"
// - "Full Access just for $4.99/week"
// - "%50 OFF" badge for discounts
// - "Already Active Subscription" for current tier@StateObject private var config: AKConfig = .AKConfigBuilder()
.setAppName("MyApp")
.setSubscriptionType(.onlySubscription) // or .freemium
.setApiKey("appl_YOUR_REVENUECAT_KEY")
.build()ContentView()
.presentPaywallIfNeeds // Auto-shows paywall when needed
.environmentObject(config)// Automatic trigger
if !config.isSubscripted {
config.paywall = true // Shows paywall automatically
}
// Or check before premium features
Button("Premium Feature") {
if config.isSubscripted {
// Show premium content
} else {
config.paywall = true
}
}