My app has a custom intent and it suggests a shortcut to the user like this:
let intent = ReadIntent()
if let shortcut = INShortcut(intent: intent) {
INVoiceShortcutCenter.shared.setShortcutSuggestions([shortcut])
}
My app always launches to handle the shortcut, so I just handle it in application(_:continue:restorationHandler:)
. There's no Intent Extension.
This is very convenient and works like a charm… however, I can't figure out how to get Siri to respond when the user triggers a shortcut. All the information I find online explains how to do it when using an Intent Extension.
In the Soup Chef example, for instance, it says:
Soup Chef marks each shortcut types with Supports background execution; this way, the system doesn’t need to open the app to handle the intent. When marked this way, the system uses Soup Chef’s intent app extension to handle the order.
And then it goes on to explain how to add a custom response in the app extension. But my app needs to launch anyway, so I don't mark that option and the intent isn't handled by the extension. Is there no way to trigger the response without it? It sounds like something really simple, and the response is already in the intent definition file, I just can't get Siri to say it. :(