summaryrefslogtreecommitdiff
path: root/DomainDig/RootTabView.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-07-16 23:49:32 -0500
committerChristian Cleberg <[email protected]>2026-07-16 23:49:32 -0500
commit20d2eaf9da95f2ccc82413c9fa02e8b0f39af575 (patch)
tree164b4ad3926578f03397a3d2aa4c5ca5e4d9e722 /DomainDig/RootTabView.swift
parentd8195992e519343d6d8ff7fb17aa98358800d913 (diff)
downloaddomain-dig-20d2eaf9da95f2ccc82413c9fa02e8b0f39af575.tar.gz
domain-dig-20d2eaf9da95f2ccc82413c9fa02e8b0f39af575.tar.bz2
domain-dig-20d2eaf9da95f2ccc82413c9fa02e8b0f39af575.zip
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
Diffstat (limited to 'DomainDig/RootTabView.swift')
-rw-r--r--DomainDig/RootTabView.swift32
1 files changed, 32 insertions, 0 deletions
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
+ }
+ }
}
}