Can I create a SiriKit shortcut that takes in a different value for a parameter each time?

I am working with a team to develop an app for iOS that uses SiriKit and it's domains/intents to allow a user to use Siri to access and query an external endpoint and recieve a response that Siri will read back to the user. We have tried using iOS 11 and the domains that SiriKit provided but none of them fit our needs. Now, we have moved to iOS 12 and made a custom intent, however the problem comes when trying to access and call this intent from Siri. Keep in mind that our cusom intent has one input parameter called userInput that is of type String. This parameter is basically the user's desired query, containing keywords that the endpoint will recognize.


We have tried many solutions so far, most notably creating an AppIntentVocabulary.plist with different words and phrases associated with our app and providing example phrases and sentences that should be associated with our intent, however we are not confident that this was set up correctly. Essentially, we are looking for a way to call the custom intent from Siri using one of the following methods:

  1. Registering a set of hard-coded phrases somewhere within Xcode that Siri will recognize and use to trigger our intent
  2. Creating a custom Siri shortcut that can prompt the user for a value for the parameter userInput, allowing them to provide a different userInput String each time while still using the same shortcut


Does anyone know if there is either a way to hard-code those desired phrases into Siri (e.g.: "Use [app name] to check for [userInput]", "Search [endpoint name] for [userInput]") or if not, if we add functionality to donate shortcuts to the app so that the user can create a recorded Siri shortcut, will the user still be able to provide a different value for the parameter userInput each time that shortcut is called, or will the shortcut use the same value every time it is called?

Replies

Custom intents currently do not provide means for user input via Siri conversation. It seems that the shortcut assumes that all necessary information was made a part of the intent when it was donated or created vis Add to Siri. It certainly would be nice to have some user interaction, and I hope that's part of the SiriKit roadmap.


The most one can currently do, it seems, is resolve the intent, and then return a failure code that lets the user jump into your app, kind of like shown in 2018 WWDC video "Building for Voice with Siri Shortcuts" around 17:00.