Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Siri Custom Intent: Variable in "Shortcuts" app

I've created a custom Siri Intent. It is visible in the "Shortcuts" app. However, it allows me to pick only from donated shortcuts, without an option to specify own parameter.

Is it possible to create a Siri Intent that supports providing parameters using the "Shortcuts" app?

My Intents configuration

enter image description here

How the result looks like:

enter image description here

What I'd like to achieve

Notice, how the fields could be pre-filed (e.g. Item field). I'd like to have the same option for the phoneNumber.

enter image description here

like image 495
Richard Topchii Avatar asked Oct 09 '18 08:10

Richard Topchii


1 Answers

EDIT

Parameters are now supported in iOS13. Documentation

Old Answer

As for now (iOS12), that doesn't work. The values for all custom parameters have to be known when you donate the Shortcut. From the documentation:

To donate the intent, create an instance of the intent class. Set its parameter values and add images to the parameters as needed.

To make it clear: A Siri Shortcut is really just a shortcut in the means of that it combines a series of fixed steps into a single button press. Think of it like a Amazon Dash Button. These buttons let you order a specific product with a button press. Say the button was created to order your favorite chocolate chip cookies from company A. So each time you press it, you order another pack of chocolate chip cookies from company A and only that. It doesn't take in any parameters during the press. So if your taste changes and you now want to order chocolate cranberry cookies from company A, you would need to replace your dash button.

As for the screenshot above. The shortcuts you see in the Shortcuts app with parameters are created by the Shortcuts team and use the URL scheme of certain apps. We can only hope that they open it up in iOS13.

like image 70
Klemens Strasser Avatar answered Nov 11 '22 14:11

Klemens Strasser