Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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...

like image 343
se_puede_dev Avatar asked Nov 13 '18 21:11

se_puede_dev


People also ask

What is a magic variable Apple shortcuts?

Magic Variables In every shortcut, each action's output is available as a Magic Variable. Unlike manual variables (described below), Magic Variables don't require you to save the output of an action for later use—simply select the output of any action to use it as a variable in any subsequent action.

What is variable shortcut?

Variable shortcuts allow you to directly go to a search result on websites that have a searchable directory such as Amazon, Jira, Linear, Twitter, LinkedIn, Youtube, etc. By inserting a value directly that replaces the search parameter in the URL, you would be able to target specific destinations.

Can Siri trigger shortcuts?

You can ask Siri to run any shortcut in your collection. Siri can launch shortcuts from most of your devices, including HomePod and Apple Watch.


1 Answers

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

like image 186
Phil_G Avatar answered Oct 01 '22 03:10

Phil_G