One of my intents responds to an optional parameter. The parameter is defined as an enum with 4 values (case today, week, month, year). I have 2 AppShortcut phrases defined, one that does not specify the parameter and another which does.
AppShortcut(intent: TopCardsIntent(),
phrases: [
"show \(.applicationName) top cards",
"show \(.applicationName) top cards for \(\.$timeframe)",
],
systemImageName: "atom"
)
The 1st phrase (with no $timeframe) ALWAYS is interpreted by Siri as a Safari lookup. The 2nd phrase ALWAYS works, but only when I don't specify timeframes '.today' or '.year'. When I do specify '.today' or '.year' - I again always get a Safari lookup.
I've tried all sorts of goofy debugging. Thinking maybe it's because '.today' is 1st and '.year' is the last enum value defined, I added a .decade value. So, the '.decade' works perfect, but '.year' still doesn't. #RandomAF
There are lots of AppShortcut phrases which I'm trying to use that always result in Safari lookups. It almost feels as if Safari has it's own set of AppShortcut phrases, and these are evaluated before mine.
Any ideas?
Here's another piece of the puzzle... I added another invocation to AppShortcut.phrases "show my top (.applicationName) cards" - and instead of doing the right thing or even launching Safari, this phrase launches a Siri disambiguation showing all the credit cards I have defined in my Apple Wallet. Further circumstantial evidence that Siri is pre-disposed to satisfying Apple-defined Intents before mine.