gpt4 book ai didi

ios - Siri 快捷方式自定义响应没有扩展名?

转载 作者:行者123 更新时间:2023-11-30 11:08:45 25 4
gpt4 key购买 nike

我的应用程序有一个自定义意图,它向用户建议一个快捷方式,如下所示:

    let intent = ReadIntent()
if let shortcut = INShortcut(intent: intent) {
INVoiceShortcutCenter.shared.setShortcutSuggestions([shortcut])
}

我的应用程序总是启动来处理快捷方式,所以我只是在 application(_:continue:restorationHandler:) 中处理它。没有 Intent 扩展。

这非常方便并且工作起来就像一个魅力......但是,我不知道如何让 Siri 在用户触发快捷方式时做出响应。我在网上找到的所有信息都解释了如何在使用意图扩展时执行此操作。

Soup Chef example例如,它说:

Soup Chef marks each shortcut types with Supports background execution; this way, the system doesn’t need to open the app to handle the intent. When marked this way, the system uses Soup Chef’s intent app extension to handle the order.

然后继续解释如何在应用扩展中添加自定义响应。但我的应用程序无论如何都需要启动,所以我没有标记该选项,并且扩展程序不会处理该意图。没有它就没有办法触发响应吗?这听起来非常简单,而且响应已经在意图定义文件中,我只是无法让 Siri 说出它。 :(

最佳答案

据我所知,只有当 Intent 在后台执行时,你才能让 Siri 做出响应。这只能通过将意图标记为“支持后台执行”并使用意图扩展来实现。

关于ios - Siri 快捷方式自定义响应没有扩展名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52414983/

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