使用 Sirikit 创建便笺时,我可以解析标题和内容,但不能解析 groupName。Siri 理解文件夹名称,但 po intent 始终返回 groupName = ""。
func resolveGroupName(forCreateNote intent: INCreateNoteIntent, with completion: @escaping (INSpeakableStringResolutionResult) -> Swift.Void) {
if let groupName = intent.groupName {
NSLog("%@", groupName)
completion(INSpeakableStringResolutionResult.success(with: groupName))
} else {
completion(INSpeakableStringResolutionResult.needsValue()) //endless loop
}
}
这只发生在模拟器中。在设备上,它不会询问文件夹名称,也不会在断点处停止。不能在设备上调试 siri 扩展吗?
好像句子有问题。如果我将此 siri 查询直接放在模式中,它正在模拟器中工作,并且我在日志中看到正确的组名“f”:
Create a note called c in my f folder saying s in myappname
但如果我替换 f 或 s,则不会。句子有错误吗?我在哪里可以找到正确句子的例子?
我从 WWDC 演示文稿中获取了这个:
Create a note called WWDC in my presentation folder saying SiriKit in UnicornNotes