首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带有VoIP call应用程序的SiriKit在iOS 10中不起作用

带有VoIP call应用程序的SiriKit在iOS 10中不起作用
EN

Stack Overflow用户
提问于 2016-09-16 14:02:06
回答 1查看 680关注 0票数 1

我正在做VoIP调用应用程序。在那里我可以通过我的应用程序进行调用。我集成了SiriKit设置并添加了以下代码。

代码语言:javascript
复制
#pragma mark -Start Audio Call
- (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);
}

但是,它不是通过我的应用程序拨打电话。它通过本地拨号器拨打电话,有时会显示尚未安装siri的应用程序。有没有人可以指导我和打电话后,如何保存通话记录。谢谢!

EN

回答 1

Stack Overflow用户

发布于 2019-05-24 14:47:52

我也遇到过这个问题!

在我的情况下,这是因为我正在用中文调用Siri!我花了半天才弄明白!

如果我把Siri语言改成英语,一切都很好!

在中文中,无论我如何指定应用程序,Siri都只能通过本地拨号器进行呼叫。

我不确定这是否也发生在其他语言上,因为我只能测试这两种语言。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39524668

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档