-26
私はSiriを通じて通話を開始する必要のあるVoIPアプリケーションを実装しています。私はSiriを通じて電話をかけることができました。しかし、問題は、連絡先がアプリケーションの連絡先リストにないのに、アプリケーションが起動されるたびに問題です。Siri - 音声通話のskypeに似た連絡先検索の動作
どうやってそれを処理するかわかりません。アプリケーションがSkypeのようにその連絡先を持っていない場合は、アプリケーションを起動しないことを意味します。
うん、スカイプは<ユーザーを見つけませんでした。
誰に電話しますか?
ベローは、拡張ハンドラのための私のコードスニペットです:
- (id)handlerForIntent:(INIntent *)intent {
// This is the default implementation. If you want different objects to handle different intents,
// you can override this and return the handler you want for that particular intent.
return self;
}
#pragma mark - INStartAudioCallIntentHandling
- (void)resolveContactsForStartAudioCall:(INStartAudioCallIntent *)intent
withCompletion:(void (^)(NSArray<INPersonResolutionResult *> *resolutionResults))completion{
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);
}
(http://meta.stackoverflow.com/questions/340839/user-answers-a-question-of -another-user-and-asks-the-same-questions-again-already?cb = 1)のようになります。私はdownvotingを止めることができると思う。 –
@ThomasWellerご返信ありがとうございます。私はメタ・ディスカッションでそれを明確にしようとしました。間違いは私のものでした。私はそれについて謝罪しました。まだダウン投票しています。 – makboney