summaryrefslogtreecommitdiff
path: root/Shared/DomainDigShareInbox.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-07-17 08:36:05 -0500
committerChristian Cleberg <[email protected]>2026-07-17 10:12:36 -0500
commitb4b94d54cbed9334a28cdcd70d3a8a0fd06e04ef (patch)
tree8fa4b408729da32ec2c547081ec2bba13b893fa2 /Shared/DomainDigShareInbox.swift
parent065e1e77ff00e8f9c8785393b5eba6c3e0bb2bb1 (diff)
downloaddomain-dig-b4b94d54cbed9334a28cdcd70d3a8a0fd06e04ef.tar.gz
domain-dig-b4b94d54cbed9334a28cdcd70d3a8a0fd06e04ef.tar.bz2
domain-dig-b4b94d54cbed9334a28cdcd70d3a8a0fd06e04ef.zip
Implement v4.6.0: sweep Live Activity, share extension, iPad split view, actionable notifications
- Sweep Live Activity: SweepActivityAttributes (Shared/), lock-screen + Dynamic Island UI in the widget extension, driven by SweepActivityController wired into the batch pipeline (begin/update/end); NSSupportsLiveActivities in Info.plist. - Share extension (DomainDigShareExtension): accepts a web URL from the share sheet, extracts the host, and hands it to the app via the App Group inbox (DomainDigShareInbox); the app consumes it on activation and inspects it. - iPad layout: RootTabView uses NavigationSplitView in the regular size class and the tab bar in compact. - Actionable notifications: per-domain threadIdentifier grouping, a Re-inspect action, and tap routing into the domain detail via the intent router. - Bump version to 4.6.0 (build 38) across app, widget, and share targets.
Diffstat (limited to 'Shared/DomainDigShareInbox.swift')
-rw-r--r--Shared/DomainDigShareInbox.swift28
1 files changed, 28 insertions, 0 deletions
diff --git a/Shared/DomainDigShareInbox.swift b/Shared/DomainDigShareInbox.swift
new file mode 100644
index 0000000..3a577e7
--- /dev/null
+++ b/Shared/DomainDigShareInbox.swift
@@ -0,0 +1,28 @@
+import Foundation
+
+/// App Group handoff from the share extension to the app.
+///
+/// Share extensions cannot reliably open their host app, so the extension
+/// drops the shared domain here and the app consumes it the next time it
+/// becomes active, routing it into an inspection.
+enum DomainDigShareInbox {
+ private static let key = "pendingInspectDomain"
+
+ private static var defaults: UserDefaults? {
+ UserDefaults(suiteName: DomainDigWidgetStore.appGroupID)
+ }
+
+ static func write(domain: String) {
+ defaults?.set(domain, forKey: key)
+ }
+
+ /// Returns and clears the pending domain, if any.
+ static func consume() -> String? {
+ guard let defaults,
+ let domain = defaults.string(forKey: key),
+ !domain.isEmpty
+ else { return nil }
+ defaults.removeObject(forKey: key)
+ return domain
+ }
+}