问题
I am trying to build a simple app which can be triggered by google assistant. Like if the users say, "Hey Google, Open TestApp" or "Hey Google, perform xyz from TestApp". What would be the best approach? Dialogflow?
回答1:
Saying "Okay, Google - do [something] with [your app]" in order to open your app to fulfill a query is called a Google Voice Action and you can add these to your app quite easily. See the documentation here for full details. Keep in mind - for these to work, your app does need to be in the Play Store, uploaded as a beta at the very least.
The Google Assistant is a little bit different - it's more conversational and doesn't take the user directly to your app. Instead, it takes the user's input, looks for the appropriate app to handle the query, feeds the query to your app, and then returns the response, within Google Assistant itself. This is all about having a conversation with an app, from the Google Assistant, without actually opening up your app.
来源:https://stackoverflow.com/questions/50033631/how-do-i-use-google-assistant-to-trigger-my-application