我已经设置了一个自定义意图,除了没有调用处理程序之外,它似乎一切正常。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
Run Code Online (Sandbox Code Playgroud)
我在 if 语句和两个 return 语句处都有断点。他们都没有受到打击。我也从未在 xCode 的控制台日志中看到“In handlerForIntent”。
我猜这是我错过的相当简单的事情,但我没有看到。欢迎任何建议?
我遇到了同样的问题 - 没有调用处理程序。
最后我发现,虽然该项目支持 iOS 11.4,但它最初将 IntentExtension 目标设置为 iOS 13。我用于测试的设备有 12.4。
所以我的建议是:检查每个目标的部署目标。
| 归档时间: |
|
| 查看次数: |
716 次 |
| 最近记录: |