Sirikit StartAudioCall失败 [英] Sirikit StartAudioCall Fail
问题描述
测试背景:Xcode:Xcode8 beta6iPhone:iOS10 beta6语言:object-c
Test Background: Xcode: Xcode8 beta6 iPhone: iOS10 beta6 Language: object-c
我已在我的应用程序中使用startAudioCall sirikit来测试我的应用程序调用.但是,sirikit在某些情况下会失败:如果此人的名字是本地联系人的名字,当我说"Call firstname myApp"时,siri可以启动myApp成功获取此联系人姓名但是,如果此人的名字既是名字又是姓氏,那么当我说呼叫名字(或名字和姓氏均为myApp)"时,siri会通过电话(而非myApp)呼叫此人
I have used startAudioCall sirikit in my App to test my app call. However, the sirikit will fail in some situation: If the person's name is a first name in local contact, when I say "Call firstname myApp", siri can start myApp get this contact name successfully But if the person's name is both first name and last name, when I say "Call firstname(or both first name and last name) myApp" , siri will call this person using phone call(not myApp)
例如:如果John在我的电话联系人中,并且我说给John myApp打电话",这将启动myApp并成功获取此联系人姓名.但是,如果John Smith与我的电话联系,并且我说给John(或John Smith)myApp打电话",则siri将使用电话呼叫此人(而不是myApp)
For exsample: if John in my phone contact, and I say "call John myApp", this will start myApp and get this contact name successfully. But if John Smith in my phone contact, and I say "call John(or John Smith) myApp" , siri will use phone call to call this person(not 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);
}
这是我有关音频通话的代码.有人可以帮忙吗?非常感谢
And Here is my code about audiocall. Anyone can help ? Thx a lot
推荐答案
将应用程序名称从"ST Wifi呼叫"更改为"testApp"后,我已解决了此问题.
I have fixed this issue, after I changed the App name from "ST Wifi Calling" to "testApp".
现在,无论我说使用testApp呼叫约翰"还是使用testApp呼叫约翰·史密斯",在sirikit上运行都很好
Now, no matter I say "Use testApp to call John" or "Use testApp to call John Smith", it's going well on sirikit
我认为Siri很难识别带有空格的长应用名称
I think it's too hard for Siri to recognize a long App name with space
这篇关于Sirikit StartAudioCall失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!