gpt4 book ai didi

ios - 如何允许用户通过Siri在iOS应用中进行搜索

转载 作者:行者123 更新时间:2023-12-01 18:37:58 26 4
gpt4 key购买 nike

我们有一个应用程序(我们称它为MyOracle),其中包含许多对公司用户有用的信息。

用户想要在应用程序中搜索信息,如下所示:

“嘿Siri-在MyOracle中搜索有关气候变化的文章”

看一下SiriKit,它似乎只提供了一些非常具体/不是非常有用的意图,看来这是不可能的。

还是有另一种使用全局搜索API或语音识别API的方法?

最佳答案

您必须使用快捷方式和自定义意图来完成此操作,可以使用iOS 12 new siri Apple Doc找到它

有了这个,很容易在应用程序中添加我们的短语和自定义意图,并且siri会为我们得到它。
if let shortcut = INShortcut(intent: order.intent) {
let addVoiceShortcutVC = INUIAddVoiceShortcutViewController(shortcut: shortcut)
addVoiceShortcutVC.delegate = self
present(addVoiceShortcutVC, animated: true, completion: nil)
}

这对我有用。

关于ios - 如何允许用户通过Siri在iOS应用中进行搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48581215/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com