2016-08-27 8 views
1

テストの背景: のXcode:Xcode8のbeta6 iPhone:iOS10 beta6 言語:オブジェクト-CシリキットStartAudioCall失敗

私は私のアプリの呼び出しをテストするために私のアプリでstartAudioCallのシリキットを使用していました。しかし、シルキットはいくつかの状況で失敗するでしょう: 人の名前がローカルの連絡先の名字である場合、私は "コールファーストネームmyApp"と言うと、siriはmyAppを開始することができますこの連絡先の名前を正常に取得 しかし、 (私の電話ではなく)電話を使ってこの人に電話します。

例: 私の電話の連絡先にJohnがいれば、名前と姓は「私の名前と姓のmyAppを呼んでください」と言うとき、私は "John myAppに電話する"と言います。これはmyAppを起動し、この連絡先の名前を正常に取得します。 しかし、ジョン・自分の携帯電話の連絡先でのスミス、と私が言う「ジョン(またはジョン・スミス)を呼び出して、myApp」は、シリはこの人(ない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); 
} 

、ここではについての私のコードですaudiocall。 誰でも手伝いできますか? Thx a lot

+0

「John myAppに電話する」と言うと、siriがアプリの代わりに電話を使用すると、resolveContactsForStartAudioCallメソッドが呼び出されますか? – rocky

+0

いいえ、それは解決するために来ません.ContactsForStartAudioこの関数を呼び出すので、私はこのケースをどのように制御するか分かりません。 – Vaycent

答えて

1

アプリ名を「ST Wifi Calling」から「testApp」に変更した後、この問題を修正しました。さて、「ジョン・スミスを呼び出すために使用でTestApp」または「ジョンの呼び出しに使用でTestAppを」私が言うに関係なく、それはシリキット

にも起こっているの

私はそれをして、長いアプリケーション名を認識するシリのためにあまりにも難しいことだと思いますスペース

+0

この男は同じ問題を報告し、レーダーを提出するように言われました。私のアプリ「Kitchen Wall」は機能しませんが、表示名を「KitchenWall」に変更すると完全に機能します。 https://forums.developer.apple.com/message/171140#171140 –