From 20d2eaf9da95f2ccc82413c9fa02e8b0f39af575 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Thu, 16 Jul 2026 23:49:32 -0500 Subject: DomainDig v4.5.0: Add App Intents, Shortcuts, and a domaindig:// deep link - Add InspectDomainIntent that runs the headless inspection pipeline and returns a summary for Shortcuts, Spotlight, the Action button, and Siri - Add AddToWatchlistIntent that opens the app and tracks a domain through the existing premium-checked path via an in-process router - Register the domaindig:// URL scheme with inspect/watch deep links routed in RootTabView (onOpenURL) - Expose both intents through DomainDigShortcuts (AppShortcutsProvider) - Bump AppVersion/marketing version to 4.5.0 and build number to 37 --- DomainDig/RootTabView.swift | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'DomainDig/RootTabView.swift') diff --git a/DomainDig/RootTabView.swift b/DomainDig/RootTabView.swift index f2c9f6c..72038a1 100644 --- a/DomainDig/RootTabView.swift +++ b/DomainDig/RootTabView.swift @@ -11,6 +11,7 @@ private enum RootTab: Hashable { struct RootTabView: View { @Bindable var viewModel: DomainViewModel @State private var purchaseService = PurchaseService.shared + @State private var intentRouter = DomainDigIntentRouter.shared @State private var selectedTab: RootTab = FeatureAccessService.currentTier == .free ? .inspect : .dashboard var body: some View { @@ -82,5 +83,36 @@ struct RootTabView: View { selectedTab = .dashboard } } + .onOpenURL { url in + guard let action = DomainDigDeepLink.action(from: url) else { return } + perform(action) + } + .onChange(of: intentRouter.pendingAction) { _, action in + consume(action) + } + .task { + consume(intentRouter.pendingAction) + } + } + + private func consume(_ action: DomainDigDeepLink.Action?) { + guard let action else { return } + intentRouter.pendingAction = nil + perform(action) + } + + private func perform(_ action: DomainDigDeepLink.Action) { + switch action { + case let .inspect(domain): + viewModel.domain = domain + selectedTab = .inspect + viewModel.run() + case let .watch(domain): + // On success show the dashboard (where tracked domains live); on + // failure stay put so the upgrade/paywall alert surfaces in place. + if viewModel.trackDomain(domain: domain, availabilityStatus: nil) { + selectedTab = .dashboard + } + } } } -- cgit v1.2.3