I'm implementing the iOS 16 AppIntents framework and it works fine except when I try to trigger it with Siri, which just pulls up results from the web. Here's a very simple version I made on an empty project.
import Foundation
import AppIntents
@available(iOS 16.0, *)
struct ShowMeBooks: AppIntent {
static var openAppWhenRun: Bool = false
static var title: LocalizedStringResource = "Show me my books"
func perform() async throws -> some IntentPerformResult {
let x = 1 + 1
return .finished(dialog: "Here are your books")
}
}
@available(iOS 16.0, *)
struct SouthwestShortcuts: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: ShowMeBooks(),
phrases: ["Show me my books on \(.applicationName)"]
)
}
}