【问题标题】:SiriKit (iOS 12) Custom Intent Handler Not Being CalledSiriKit (iOS 12) 自定义 Intent 处理程序未被调用
【发布时间】:2019-03-05 08:55:46
【问题描述】:

我已经设置了一个自定义意图,除了没有调用处理程序之外,它似乎一切正常。 Siri 的响应好像一切都成功了,但我在控制台输出中看不到任何内容,也没有触发我的断点...这是处理程序...

@implementation IntentHandler  

- (id)handlerForIntent:(INIntent *)intent  
{  
    // This is the default implementation.  If you want different objects to handle different intents,  
    // you can override this and return the handler you want for that particular intent.  

  NSLog(@"In handlerForIntent.");  

  if ([intent isKindOfClass:[TriggerSceneIntent class]])  
  {  
       return [SceneIntentsHandler sharedInstance];  
  }  

    return self;  
}  

@end  

我在 if 语句和两个 return 语句都有断点。他们都没有被击中。我也从未在 xCode 的控制台日志中看到“In handlerForIntent”。

我猜这是我错过的相当简单的事情,但我没有看到它。欢迎任何建议?

【问题讨论】:

  • 有人解决了吗?
  • @birdcage 仍然是个问题。似乎项目或意图文件可能会失控。我正在做的另一个项目运行良好。

标签: ios12 sirikit


【解决方案1】:

我遇到了同样的问题 - 没有调用处理程序。

最后我发现,虽然该项目支持 iOS 11.4,但它最初将 IntentExtension 目标设置为 iOS 13。我用于测试的设备有 12.4。

所以我的建议是:检查每个目标的部署目标。

【讨论】:

  • 这为我修好了!
猜你喜欢
  • 2022-01-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-08-16
  • 1970-01-01
相关资源
最近更新 更多