Search code examples
iossirisirikitsirishortcuts

Is it possible to have a Siri shortcut with a variable parameter?


There are a dozen related actions that users of my app can perform, and I'd like to let them do it with Siri, but I'm unsure how to effectively do that. I know I can donate a INIntent when a user performs an action, but is it possible to donate an action with a customizable parameter? The user could, for example say "Perform action 1", 1 being the parameter. Would the user have to perform each of the 12 actions before they could do that with Siri? I also know it's possible to use NSUserActivity and INInteractions to make it easier for users to use Siri with an app, but I can't find any resources that will let me know if what I want to do is at all possible...


Solution

  • It is not possible to have a variable parameter. Siri shortcuts are for actions, which are executed by the user, so all needed information should be available when donated. If you want to perform actions with different parameters, you have to donate for each of these actions.

    You can also check this post in the apple developer forum about the same problem: https://forums.developer.apple.com/message/326487#326487