Reputation: 1243
I use the INSearchForNotebookItemsIntent to display lists and items in Siri's interface with a custom Intent UI. When returning a successful INSearchForNotebookItemsIntentResponse with only a single task list in the TaskLists array property and (and the tasks array of the response empty), SiriKit fails to load my custom Intents UI and instead loads Apple's default one.
If multiple multiple task lists are supplied, the custom Intents UI is loaded as expected.
What is even worse is that Apple's UI has these weird checkboxes that neither coordinate with my app or the custom Intent UI nor do anything. They're not wired anywhere and even though they look identical to Apple's Reminder's checkboxes, tapping them does nothing and there's no way to provide interaction.
To get around this, I've been stuffing a dummy INTask object into the tasks array on the response, which causes the the Custom UI to render (discovered this trick from the Things app's Siri interface) but would really really like to not do this: It adds a residual "header" at the bottom of the custom UI that says Items and when Siri speaks, she'll say something along the lines of "Two items were found" since the dummy is being considered alongside the found list.
I've learned YMMV with the SiriKit API since I started working with it, but this is a particular issue that plagues my app and continues to exist into the iOS 12 previews.
Upvotes: 1
Views: 92
Reputation: 775
This relates to this post from almost the same time for which you provided the key insight. It seems that for response.notes
and response.taskLists
, it takes two or more items for the IntentsUI extension to be invoked. For response.tasks
, one or more will suffice.
If you change from one task list to just a set of tasks (even just one works), your one problem may be solved. And if you don't like the radio buttons, set INTask.taskType
to .notCompletable
or .unknown
. I'm guessing that tapping the radio button will trigger some activity for that task with that identifier, but haven't experimented with that b/c it's not applicable to my app.
Upvotes: 1