一些我的iOS AppShortcut短语有效,但有些会启动Safari。

huangapple go评论71阅读模式
英文:

Some of my iOS AppShortcut phrases work, but some launch Safari?

问题

我有一个意图可以响应一个可选参数。该参数被定义为一个具有4个值的枚举(分别是今天、本周、本月和今年)。我定义了两个AppShortcut短语,一个不指定参数,另一个指定参数。

第一个短语(没有$timeframe)总是被Siri解释为Safari查找。
第二个短语总是有效,但只有当我不指定时间范围'.today'或'.year'时。当我指定'.today'或'.year'时,又总是得到Safari查找。

我尝试了各种诡异的调试。考虑到'.today'是第一个,'.year'是最后一个枚举值定义,我添加了一个'.decade'值。所以,'.decade'运行得很完美,但'.year'仍然不行。#RandomAF

有很多AppShortcut短语我正尝试使用,总是导致Safari查找。几乎感觉像是Safari有它自己的AppShortcut短语集,这些在我的之前被评估。

有什么想法吗?

英文:

One of my intents responds to an optional parameter. The parameter is defined as an enum with 4 values (case today, week, month, year). I have 2 AppShortcut phrases defined, one that does not specify the parameter and another which does.

	AppShortcut(intent: TopCardsIntent(),
					phrases: [
						"show \(.applicationName) top cards",
						"show \(.applicationName) top cards for \(\.$timeframe)",
					],
					systemImageName: "atom"
	)

The 1st phrase (with no $timeframe) ALWAYS is interpreted by Siri as a Safari lookup.
The 2nd phrase ALWAYS works, but only when I don't specify timeframes '.today' or '.year'. When I do specify '.today' or '.year' - I again always get a Safari lookup.

I've tried all sorts of goofy debugging. Thinking maybe it's because '.today' is 1st and '.year' is the last enum value defined, I added a .decade value. So, the '.decade' works perfect, but '.year' still doesn't. #RandomAF

There are lots of AppShortcut phrases which I'm trying to use that always result in Safari lookups. It almost feels as if Safari has it's own set of AppShortcut phrases, and these are evaluated before mine.

Any ideas?

答案1

得分: 0

我没有意识到这一点,但在苹果的“捷径”应用中有一个 (i) 按钮 - 当点击它时,会显示 2 个切换按钮。其中一个启用了“聚光灯”,另一个启用了“Siri”。

对我的问题的解决方案是通过苹果的“反馈助手”提供的 - 我只需要 (a) 知道这个设置,以及 (b) 确保“Siri”切换开启。

英文:

I didn’t realize this, but there’s an (i) button in Apple’s Shortcuts app - and when tapped it shows 2 toggles. One of which enables Spotlight, and the other enables Siri.

The solution to my question was provided via Apple’s Feedback Assistant - I just needed to (a) know about this setting, and (b) ensure the Siri toggle was turned on.

huangapple
  • 本文由 发表于 2023年2月18日 02:23:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/75488011.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定