0

Implementing both custom and standard SiriKit intents and generally having good success. In principle, in the info.plist of both the Intents and IntentsUI extensions, you include the intent class supported, and the UI extension is run after the intent is successfully handled.

That is working for my custom intent (eg, MyAppCustomIntent) and for one of the standard intents (INSendMessageIntent). But for another intent I've implemented, INSearchForNotebookItemsIntent, the UI extension is never launched. The Intents extension is launched, the Siri interaction is processed accurately, and the default response for that intent is accurately provided by Siri. But the IntentsUI for that intent class simply is never attached by the debugger.

I'm using just one Intents extension and one IntentsUI extension, double-checked that all three Intents classes are in their respective IntentsSupported array for each extension, and added the class names by copy & paste to avoid misspellings.

What else might be preventing the UIExtension from launching for INSearchForNotebookItemsIntent beyond a failure response from the intent or improper setup of IntentsSupported in info.plist?

JKaz
  • 765
  • 6
  • 18
  • 1
    WOW. I've been messing with this issue for _years_ and literally just posted a question a few minutes ago. I've found the custom UI will attach if you supply some items (taskList, tasks) on the successful response object, even empty objects, even though they are optional. – Dandy Aug 06 '18 at 05:15
  • Serendipity! Thank you! I was including one item, response.note as [INNote(...)]. Seems that's the problem. If I added a response.task = [INTask(...)], IntentsUI launched. If I added a second note [INNote(...), INNote(...)], IntentsUI launched. If I used just a single INTask and zero INNotes, it launched. The only non-launch was if one and only one INNote. That means my UI would only apply if 2 or more notes? I'm not seeing the logic in that. Do you think it's a bug worth reporting? Also, if you post your comment as answer, I'd be happy to accept it. Thank you! – JKaz Aug 06 '18 at 15:30
  • I would; my original bug report has been sitting at about a year now and I think this is a significant issue. – Dandy Aug 07 '18 at 12:15

1 Answers1

0

Repurposed this from my comment above, which is an answer to the question though not technically the true solution since this seems like a bug in the API (that has lasted since its introduction).

I've found the custom UI will attach correctly if you supply more than one item (taskList, tasks, notes) on the successful response object, even empty objects, even though they are optional.

For example, when a single taskList is found in the search, I'll add a blank task object to the response.

response.tasks = [INTask(title: INSpeakableString(spokenPhrase: ""), status: .unknown, taskType: .unknown, spatialEventTrigger: nil, temporalEventTrigger: nil, createdDateComponents: nil, modifiedDateComponents: nil, identifier: "BugFixTask")]
Dandy
  • 1,203
  • 1
  • 16
  • 31
  • It was answer sufficient to let me build workaround, and to report it as potential bug. :) Note: In my tests a single task worked properly. – JKaz Aug 07 '18 at 00:30