诗丽吉 StartAudioCall 失败
Sirikit StartAudioCall Fail
测试背景:
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 会使用 phone call(not myApp)
给这个人打电话
例如:
如果 John 在我的 phone 联系人中,我说 "call John myApp",这将启动 myApp 并成功获取此联系人姓名。
但是如果 John Smith 在我的 phone 联系人中,并且我说 "call John(or John Smith) myApp" ,siri 将使用 phone 呼叫这个人(不是 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);
}
这是我关于语音通话的代码。
任何人都可以帮忙吗?非常感谢
我将应用程序名称从 "ST Wifi Calling" 更改为 "testApp" 后,我已经解决了这个问题。
现在不管我说"Use testApp to call John"还是"Use testApp to call John Smith",在sirikit上都很顺利
我觉得Siri很难识别space
的长App名称
测试背景: 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 会使用 phone call(not myApp)
给这个人打电话例如: 如果 John 在我的 phone 联系人中,我说 "call John myApp",这将启动 myApp 并成功获取此联系人姓名。 但是如果 John Smith 在我的 phone 联系人中,并且我说 "call John(or John Smith) myApp" ,siri 将使用 phone 呼叫这个人(不是 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);
}
这是我关于语音通话的代码。 任何人都可以帮忙吗?非常感谢
我将应用程序名称从 "ST Wifi Calling" 更改为 "testApp" 后,我已经解决了这个问题。
现在不管我说"Use testApp to call John"还是"Use testApp to call John Smith",在sirikit上都很顺利
我觉得Siri很难识别space
的长App名称