IntentsUI extension not reached for INSearchForNotebookItemsIntent

懵懂的女人 提交于 2019-12-11 14:49:48

问题


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?


回答1:


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")]


来源:https://stackoverflow.com/questions/51698967/intentsui-extension-not-reached-for-insearchfornotebookitemsintent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!