diff options
| author | Christian Cleberg <[email protected]> | 2026-04-22 12:39:23 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-22 12:39:23 -0500 |
| commit | dcf4135ec376d357b8fafc0101a75b674e76329a (patch) | |
| tree | 498e0782b34778b6f6d871d2adc230437fe77904 /DomainDig/RootTabView.swift | |
| parent | 37b02e5ee360d61751951b77b7b556165a3af1fc (diff) | |
| download | domain-dig-dcf4135ec376d357b8fafc0101a75b674e76329a.tar.gz domain-dig-dcf4135ec376d357b8fafc0101a75b674e76329a.tar.bz2 domain-dig-dcf4135ec376d357b8fafc0101a75b674e76329a.zip | |
feat(v3.1.0): add StoreKit integration and Pro tier
• implement PurchaseService using StoreKit 2
• activate feature tiers based on entitlement
• add minimal paywall and restore flow
• enforce free-tier limits with upgrade paths
• integrate Pro status into settings
• ensure clean and non-intrusive monetization flow
Diffstat (limited to 'DomainDig/RootTabView.swift')
| -rw-r--r-- | DomainDig/RootTabView.swift | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/DomainDig/RootTabView.swift b/DomainDig/RootTabView.swift index 19ea444..2d2b8ed 100644 --- a/DomainDig/RootTabView.swift +++ b/DomainDig/RootTabView.swift @@ -2,8 +2,11 @@ import SwiftUI struct RootTabView: View { @Bindable var viewModel: DomainViewModel + @State private var purchaseService = PurchaseService.shared var body: some View { + let _ = purchaseService.currentTier + TabView { ContentView(viewModel: viewModel) .tabItem { @@ -38,5 +41,27 @@ struct RootTabView: View { Label("Settings", systemImage: "gearshape") } } + .sheet(isPresented: Binding( + get: { viewModel.isPaywallPresented }, + set: { viewModel.isPaywallPresented = $0 } + )) { + PaywallView() + } + .alert(item: Binding( + get: { viewModel.upgradePrompt }, + set: { viewModel.upgradePrompt = $0 } + )) { prompt in + Alert( + title: Text(prompt.title), + message: Text(prompt.message), + primaryButton: .default(Text("Open Paywall")) { + viewModel.upgradePrompt = nil + viewModel.isPaywallPresented = true + }, + secondaryButton: .cancel(Text("Continue")) { + viewModel.upgradePrompt = nil + } + ) + } } } |
