Shared/Intents/LogPassiveReportIntent.swift (1294B)
1import AppIntents
2
3
4
5
6
7
8
9
10
11struct LogPassiveReportIntent: AppIntent, LiveActivityIntent {
12 static let title: LocalizedStringResource = "Instant Report"
13 static let description = IntentDescription(
14 "Files this report without a survey. You can fill it in later, or leave it as it is.")
15 static let supportedModes: IntentModes = .background
16
17 @Dependency private var logger: any InstantReportLogging
18
19 func perform() async throws -> some IntentResult & ProvidesDialog {
20 try await logger.logInstantReport()
21 return .result(dialog: "Filed.")
22 }
23}
24
25
26
27protocol InstantReportLogging: Sendable {
28 func logInstantReport() async throws
29}