From dcf4135ec376d357b8fafc0101a75b674e76329a Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Wed, 22 Apr 2026 12:39:23 -0500 Subject: feat(v3​.1​.0): add ​Store​Kit integration and ​Pro tier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • implement Purchase​Service 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 --- DomainDig/RootTabView.swift | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'DomainDig/RootTabView.swift') 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 + } + ) + } } } -- cgit v1.2.3