【问题标题】:SiriKit with VoIP call Application not working in iOS 10带有 VoIP 呼叫应用程序的 SiriKit 在 iOS 10 中不起作用
【发布时间】:2016-09-16 06:02:05
【问题描述】:

我正在做 VoIP 呼叫应用程序。在那里我可以通过我的应用程序拨打电话。我已经集成了 SiriKit 设置并添加了以下代码。

#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 设置的应用程序。 任何人都可以指导我和拨打电话后,如何保存通话记录。 谢谢!

【问题讨论】:

标签: iphone xcode voip ios10 sirikit


【解决方案1】:

我也遇到过这个问题!!!

我的情况,因为我用中文打电话给Siri!!!!我花了半天时间才弄明白!!

如果我将 Siri 语言更改为英语并且一切正常!

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-08-29
    • 1970-01-01
    • 2023-03-26
    • 2018-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多