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 INInteraction
s 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...
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With