Sirikit StartAudioCall失败
测试背景:Xcode:Xcode8 beta6 iPhone:iOS10 beta6语言:object-c
我在我的应用程序中使用了startAudioCall sirikit来测试我的应用程序调用。 然而,sirikit在某些情况下会失败:如果该人的姓名是本地联系人的名字,当我说“呼叫firstname myApp”时,siri可以启动myApp成功获取此联系人姓名但是如果该人的名字是名字和姓氏,当我说“呼叫名字(或名字和姓氏)myApp”时,siri将使用电话呼叫此人(不是myApp)
举例来说:如果John在我的手机中联系,并且我说“打电话给John myApp”,这将启动myApp并成功获取此联系人姓名。 但如果John Smith在我的手机中联系,我说“打电话给约翰(或约翰史密斯)myApp”,siri会用电话打电话给这个人(不是myApp)
- (void)resolveContactsForStartAudioCall:(INStartAudioCallIntent *)intent withCompletion:(void (^)(NSArray *resolutionResults))completion{ NSLog(@"maytest resolveContactsForStartAudioCall"); NSArray *recipients = intent.contacts; NSMutableArray *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); }
这是关于audiocall的代码。 有人可以帮忙吗? 多谢
我将应用程序名称从“ST Wifi Calling”更改为“testApp”后,我解决了这个问题。
现在,无论我说“使用testApp打电话给约翰”或“使用testApp打电话给约翰史密斯”,它在sirikit上都很顺利
我认为Siri很难用空间识别长的App名称