2016-08-27 4 views
1

Test-Hintergrund: Xcode: Xcode8 beta6 iPhone: iOS10 beta6 Sprache: Objekt-cSirikit StartAudioCall Ausfallen

I startAudioCall sirikit in meiner App verwendet haben meine app Aufruf zu testen. Das sirikit wird jedoch in einer bestimmten Situation fehlschlagen: Wenn der Name der Person ein Vorname in lokalem Kontakt ist, wenn ich sage "Ruf Vorname myApp", kann Siri MyApp beginnen, diesen Kontaktnamen erfolgreich zu bekommen Aber wenn der Name der Person beide zuerst ist Name und Nachname, wenn ich sage "Ruf Vorname (oder Vor- und Nachname) myApp", ruft Siri diese Person mit Anruf an (nicht myApp)

Zum Beispiel: wenn John in meinem Telefon Kontakt, und ich sage "call John myApp", dies wird myApp starten und diesen Kontaktnamen erfolgreich erhalten. Aber wenn John Smith in meinem Telefonkontakt, und ich sage "nennen, John (oder John Smith) myApp", siri Telefonanruf verwenden, diese Person zu nennen (nicht 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); 
} 

Und hier ist mein Code über Audiokall. Jeder kann helfen? Thx viel

+0

Also, wenn Sie sagen, "John myApp anrufen" und Siri Telefon statt Ihrer App verwendet, wird Ihre resolveContactsForStartAudioCall-Methode aufgerufen? – rocky

+0

Nein, es wird nicht zur Lösung kommenContactsForStartAudioCall diese Funktion, also habe ich keine Ahnung, wie Sie diesen Fall steuern können. – Vaycent

Antwort

1

Ich habe dieses Problem behoben, nachdem ich den App-Namen von "ST Wifi Calling" zu "TestApp" geändert habe.

Nun, ganz gleich, ich „Use testApp nennt John“ oder sage „Use testApp John Smith zu nennen“, es geht gut auf sirikit

Ich denke, es ist zu schwer für Siri einen langen Namen der App zu erkennen, mit space

+0

Dieser Typ berichtete über das gleiche Problem und wurde aufgefordert, ein Radargerät anzulegen. Meine App "Kitchen Wall" funktioniert nicht, aber wenn ich den Anzeigenamen in "KitchenWall" ändere, funktioniert es perfekt. https://forums.developer.apple.com/message/171140#171140 –