简体   繁体   English

Google 助理操作

[英]Google Assistant Actions

I am trying to use the Google Assistant to launch an activity of my Android app with a specific parameter.我正在尝试使用 Google Assistant 来启动我的 Android 应用程序的活动,该应用程序具有特定参数。 I have read this:我读过这个:

https://codelabs.developers.google.com/codelabs/actions-1/#0 https://developers.google.com/assistant/app/action-schema https://developers.google.com/assistant/app/get-startedhttps://codelabs.developers.google.com/codelabs/actions-1/#0 https://developers.google.com/assistant/app/action-schema https://developers.google.com/assistant/app /开始

But I am confused, completely lost.但我很困惑,完全迷失了。 From my point of view, everything looks messy and confused.从我的角度来看,一切看起来都很混乱和混乱。

In the Actions Console I have created one Action Project called "Actions Project for my app".操作控制台中,我创建了一个名为“我的应用的操作项目”的操作项目。 Then I went to the DialogFlow console and modified the Default Welcome Intent and created some other intent.然后我进入 DialogFlow 控制台并修改了默认欢迎意图并创建了一些其他意图。 Both were tested using the testing option "See how it works in Google Assistant."两者都使用测试选项“查看它在 Google 助理中的工作方式”进行了测试。 It worked well doing those testings.在进行这些测试时效果很好。

Then, in another site I read that I have to create an Action.xml file in my app project in Android studio.然后,在另一个站点中,我读到我必须在 Android 工作室的应用程序项目中创建一个 Action.xml 文件。 But how do I have to do that?但是我该怎么做呢? Do I have to "export" my project "Actions Project for my app" to some xml file?我是否必须将我的项目“我的应用程序的操作项目”“导出”到某个 xml 文件? I think that documentation is not enough for clumsy people like me.我认为对于像我这样笨拙的人来说,文档是不够的。 I don't really know the next step.我真的不知道下一步。 I am really struggling with this.我真的很挣扎。

Basically I want the assistant to let the user say something, then pass that information to my app, do somework and then execute an activity to do something.基本上我希望助手让用户说些什么,然后将该信息传递给我的应用程序,做一些工作,然后执行一个活动来做一些事情。 For example, if we are talking about MyCookingApp I want this:例如,如果我们在谈论 MyCookingApp 我想要这个:

User: Ok Google, talk to MyCookingApp
Assistant: Welcome to MyCookingApp, what do you want to cook?
User: Pizza

Assistant should open my app with the parameter "Pizza".助手应该使用参数“Pizza”打开我的应用程序。 My app should display an activity with a pizza image and the recepie for it.我的应用程序应该显示一个带有比萨图像和它的接收器的活动。

Is all this possible?这一切可能吗?

Connecting your serverside Action to your Android app is not directly feasible.将服务器端 Action 连接到 Android 应用程序并不直接可行。 Actions on Google is available on a variety of surfaces beyond Android, so you can't necessarily expect the Action to immediately launch your app. Actions on Google 可在 Android 之外的各种平台上使用,因此您不一定指望 Action 会立即启动您的应用程序。 However, there are a few ways to get the behavior that you want:但是,有几种方法可以获得您想要的行为:

  • Make your response include a BasicCard which has a link to deep link into your app让您的回复包含一个BasicCard ,其中包含指向您应用的深层链接的链接
  • Look at using App Actions to achieve the behavior you want, which is designed for the Assistant to link into Android apps看看使用App Actions来实现你想要的行为,这是专为 Assistant 链接到 Android 应用程序而设计的
  • From your Action's webhook, send a push notification to the user's phone (assuming you have account linking setup) to your app to open it up从你的 Action 的 webhook 中,向用户的手机发送推送通知(假设你有帐户链接设置)到你的应用程序以打开它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Google 助理测试应用操作 - Testing App Actions with Google Assistant 如何使用 Google Assistant 测试 App Actions? - How to test App Actions using Google Assistant? Android TV 中的谷歌助手和应用操作问题 - Problem with google assistant and app actions in Android TV 为 Google 助理操作定义应用名称 - Define app name for Google Assistant actions App Action 适用于 App Actions 测试工具,但不适用于 Google Assistant - App Action Works on App Actions Test Tool But not On Google Assistant 通过谷歌助手实现 android 应用程序操作的问题 - Issue in implementing android app actions via google assistant 无法在 Google 助理中创建应用中使用的应用操作的预览 - Unable to create preview of the app actions used in the app in google assistant 如何使用Google Actions SDK遍历JS对象数组并在Google Assistant应用中显示列表选择器 - How to iterate over array of js objects and display List Selector in google assistant app using google actions sdk Google 人员是否支持 Java 中的“将 Android 应用程序扩展为具有应用程序操作的 Google 助理”? - Does Google people support “Extend an Android app to Google Assistant with App Actions” in Java? 使用Google Assistant通过语音测试应用操作的正确语法是什么? - What is the proper syntax for testing app actions via voice using google assistant?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM