2

Siri Shortcut for custom intent. I've included several parameters, some strings, one string array, and several integers. Some of the integers are for the raw value of an enum, one's a true integer value of a app property, and one uses 0 and 1 as a Boolean.

What I'm finding is that if ANY of the integers in the intent parameters passed to the INShortcut method is 0, then INShortcut fails. As long as they are all non-0, it succeeds. fwiw, the log of the intent shows all property values to be exactly as expected, whether zero or non-zero.

print(intent)
if let shortcut = INShortcut(intent: intent) {
    let vc = INUIAddVoiceShortcutViewController(shortcut: shortcut)
    vc.delegate = self
    present(vc, animated: true)
}
else { print("INShortcut failed") }

Am I delusional? Has anyone else observed this? Is the behavior documented and I just missed it?

Thanks...

JKaz
  • 765
  • 6
  • 18
  • I'm seeing exactly this behaviour. "Cannot create shortcut from intent [...] because it has no valid parameter combinations". I get an error if I try to donate the intent in an INInteraction, too. – Simon Oct 08 '18 at 17:06
  • I had to change code to accommodate the bug. Where possible, used non-0, such as having all enums start at 1, and elsewhere used String instead of Int in the definition. Makes the code tougher to follow, but I guess that beats not working at all. – JKaz Oct 08 '18 at 17:21
  • Yeah. I'm considering marking all my integer parameters as Custom and using INObjects instead. – Simon Oct 09 '18 at 08:22

0 Answers0