【问题标题】:Sirikit StartAudioCall FailSirikit StartAudioCall 失败
【发布时间】:2016-08-27 15:47:40
【问题描述】:

测试背景: Xcode:Xcode8 beta6 iPhone:iOS10 beta6 语言:object-c

我在我的应用程序中使用了 startAudioCall sirikit 来测试我的应用程序调用。但是,sirikit 在某些情况下会失败: 如果这个人的名字是本地联系人中的名字,当我说“Call firstname myApp”时,siri可以启动myApp成功获取这个联系人姓名 但是如果这个人的名字既是名字又是姓氏,当我说 "Call firstname(or both first name and last name) myApp" 时,siri 会用电话呼叫这个人(不是 myApp)

例如: 如果 John 在我的电话联系人中,我说“呼叫 John myApp”,这将启动 myApp 并成功获取此联系人姓名。 但是如果 John Smith 在我的电话中联系,并且我说 "call John(or John Smith) myApp" ,siri 将使用电话呼叫这个人(不是 myApp)

- (void)resolveContactsForStartAudioCall:(INStartAudioCallIntent *)intent
                      withCompletion:(void (^)(NSArray<INPersonResolutionResult *> *resolutionResults))completion{
NSLog(@"maytest resolveContactsForStartAudioCall");


NSArray<INPerson *> *recipients = intent.contacts;

NSMutableArray<INPersonResolutionResult *> *resolutionResults = [NSMutableArray array];



if (recipients.count == 0) {

    completion(@[[INPersonResolutionResult needsValue]]);
    return;
}else if(recipients.count==1){
    [resolutionResults addObject:[INPersonResolutionResult successWithResolvedPerson:recipients.firstObject]];
}else if(recipients.count>1){
     [resolutionResults addObject:[INPersonResolutionResult disambiguationWithPeopleToDisambiguate:recipients]];
}else{
    [resolutionResults addObject:[INPersonResolutionResult unsupported]];

}
completion(resolutionResults); 
}

- (void)confirmStartAudioCall:(INStartAudioCallIntent *)intent
               completion:(void (^)(INStartAudioCallIntentResponse *response))completion{

NSUserActivity *userActivity = [[NSUserActivity alloc] initWithActivityType:NSStringFromClass([INStartAudioCallIntent class])];
INStartAudioCallIntentResponse *response = [[INStartAudioCallIntentResponse alloc] initWithCode:INStartAudioCallIntentResponseCodeReady userActivity:userActivity];
completion(response);
}

- (void)handleStartAudioCall:(INStartAudioCallIntent *)intent
              completion:(void (^)(INStartAudioCallIntentResponse *response))completion{
NSUserActivity *userActivity = [[NSUserActivity alloc] initWithActivityType:NSStringFromClass([INStartAudioCallIntent class])];

INStartAudioCallIntentResponse *response = [[INStartAudioCallIntentResponse alloc] initWithCode:INStartAudioCallIntentResponseCodeContinueInApp userActivity:userActivity];
completion(response);
}

这是我关于音频通话的代码。 任何人都可以帮忙吗?非常感谢

【问题讨论】:

  • 所以当你说“打电话给 John myApp”并且 siri 使用手机而不是你的应用时,你的 resolveContactsForStartAudioCall 方法被调用了吗?
  • 不,resolveContactsForStartAudioCall这个函数不会来,所以,我不知道如何控制这种情况。

标签: ios voip ios10 sirikit


【解决方案1】:

在将应用名称从“ST Wifi Calling”更改为“testApp”后,我已解决此问题。

现在,无论我说“使用 testApp 调用 John”还是“使用 testApp 调用 John Smith”,sirikit 都运行良好

我认为 Siri 很难识别带有空格的长 App 名称

【讨论】:

  • 这个人报告了同样的问题,并被告知要归档雷达。我的应用程序“厨房墙”不起作用,但如果我将显示名称更改为“厨房墙”,它可以完美运行。 forums.developer.apple.com/message/171140#171140
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-12-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多