未调用SiriKit(iOS 12)自定义意图处理程序

问题描述 投票:3回答:1

我已经设置了一个自定义意图,除了未调用该处理程序以外,其他一切似乎都正常工作。 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”。

我猜这是我想念的相当简单的东西,但我没有看到。欢迎任何建议吗?

ios12 sirikit
1个回答
1
投票

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

最后我发现,尽管该项目支持iOS 11.4,但最初将IntentExtension目标设置为iOS13。我用于测试的设备具有12.4。

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

© www.soinside.com 2019 - 2024. All rights reserved.