iOS 16 Swift App Intents - Phrases Not Working as Expected

368 views Asked by At

I have defined custom App Intents using the new App Intent framework provided in iOS 16. However, not all of these phrases seem to work for Siri. Sometimes it will open another app or will perform a completely different action. Is there a different way I should be telling Siri which phrases to listen for, or do I need to use the INUIAddVoiceShortcutViewController?

For example "Start (applicationName) Timer" would open up the timer app and start a timer named "Application Name" - rather than opening the timer in the application I am building.

@available(iOS 16.0, *)
struct Shortcuts: AppShortcutsProvider {
    static var appShortcuts: [AppShortcut] = [
        AppShortcut(
            intent: StartTimer(),
            phrases: ["Start \(.applicationName) Timer"],
            systemImageName: "stopwatch.fill"
        ),
        AppShortcut(
            intent: EndTimer(),
            phrases: ["End \(.applicationName) Timer"],
            systemImageName: "stopwatch.fill"
        ),
        AppShortcut(
            intent: StartFast(),
            phrases: ["Start Fast"],
            systemImageName: "sun.min.fill"
        ),
    ]
}
0

There are 0 answers