问题
When I say "Translate English to Spanish" Siri opens the app Google Translate.
How does Siri know to launch this app and is it possible to register your app for certain keywords with Siri?
回答1:
Usually you can open an app telling Siri something like:
"Open [APP NAME]"
My guess
In your case I guess Siri is not interpreting the sentence. When you say Translate English to Spanish
Siri does try to understand what action should take and since no action with an hight Matching Rate is found then Siri tries to open the App having a name equals to the first word of your sentence.
Test 1
In Italian language the app is named Traduttore
. When I say Traduci dall'italiano all'inglese
(Translate English to Spanish) Siri does NOT open the translator because Traduttore
does not match Traduci
.
Test 2
If I say: Musica dall'italiano all'inglese
(Music italian to english) which is not a real command, Siri does open the Music app.
Siri and third parties apps
Right now the interaction between Siri and third parties apps is pretty limited, however maybe in the future Apple will provide the tools for a deeper interaction.
Maybe something like what is happening with HomeKit where Apple created an interface to make Siri and Home Devices to talk each other.
回答2:
You should look at Siri's custom vocabulary.
At the moment it is limited to your App's name and Apple specified domains e.g. Workouts or Ride Booking
But if you're lucky enough that your application falls within those categories you can map some more app specific terminology.
For example, if you had a rock climbing application, Ascent, you could start with a voice command similar to "Hey Siri, start climb" rather than "Hey Siri, start workout with Ascent"
All of your localized vocab choices should be placed into their appropriate language-specific project directories (.lproj).
来源:https://stackoverflow.com/questions/35455634/how-to-make-siri-launch-app-on-specific-keyword