Include Parameters in AppIntent invocation?

I'd like to build an AppIntent where the parameters are included in the initial invocation.

First-party example "Set a timer for 10 minutes" immediately sets new timer using the parameter 10 minutes.

Is this possible via AppIntents? Or do we have to invoke with "Set a timer" then give parameters via dialog: "for how long"? with user replying "10 minutes."

Answered by Engineer in 803324022

When you define an AppShortcut in an AppShortcutProvider on iOS or visionOS, you include your app name, and optionally one additional parameter.

Here's an overview of AppShortcuts: https://developer.apple.com/documentation/appintents/app-shortcuts

And you can see an example of an AppShortcutsProvider defining phrases with a parameter in the TrailShortcut.swift file in this sample code project: https://developer.apple.com/documentation/appintents/acceleratingappinteractionswithappintents

When you define an AppShortcut in an AppShortcutProvider on iOS or visionOS, you include your app name, and optionally one additional parameter.

Here's an overview of AppShortcuts: https://developer.apple.com/documentation/appintents/app-shortcuts

And you can see an example of an AppShortcutsProvider defining phrases with a parameter in the TrailShortcut.swift file in this sample code project: https://developer.apple.com/documentation/appintents/acceleratingappinteractionswithappintents

Include Parameters in AppIntent invocation?
 
 
Q