欢迎使用 Google Home 开发者中心,您可以在这里学习有关如何开发智能家居 Action 的新平台。注意:你将继续在 Actions 控制台中构建操作。

应用发现和深层链接

使用集合让一切井井有条 根据您的偏好保存内容并对其进行分类。

Google Home app (GHA) 是用户将智能设备连接到 Google Assistant and assign them to structures and rooms in Google Home Graph. To perform setup, users typically click through multiple screens to find your smart home Action from a list of available options. By making it easier for users to begin the setup process, you can help onboard them more quickly and reduce user setup frustration. 的主要方式

为了简化 smart home 设备上的用户入门流程,Google smart home 平台提供了一些便捷功能,可让用户更轻松地快速进入设置流程并开始使用 smart home 设备。这些功能可以轻松集成到您的 smart home 操作中,而只需编写少量代码,甚至无需编写代码。

以下列表总结了在为 Assistant 设置智能设备时,您可以实现以减少用户不便的平台功能:

  • App Discovery:借助此功能,用户可以查看用于在 GHA 中关联 Action 的建议内容信息卡;只需点击该信息卡,用户便可使用他们的第三方提供商帐号将其 smart home 设备连接到 Assistant
  • 深层链接:借助此功能,您可以在应用或产品网站中嵌入深层链接,以便用户轻松地将其 smart home 设备连接到 Assistant。点击该链接后,系统会提示用户下载 GHA(如果尚未安装),并启动帐号关联和房间分配设置流程。

实现应用发现

您可以从 Actions on Google Console after completing the Brand Verification process. No code changes are needed, however your smart home Action must already be reviewed and in production. 启用 App Discovery 功能

登录 Actions Console

转到 Actions on Google 控制台

  1. 打开您的 smart home Action 项目。
  2. 依次点击 Deploy > Brand Verification
  3. 请按照以下步骤将你的公司网站与 Action 项目相关联。
    1. Websites 面板中,点击 Connect site
    2. 输入要关联的网站的网址,然后点击 Connect。 Google 向网站所有者发送电子邮件,确认网站关联情况。
  4. Android apps 面板中,点击 Connect app 按钮,然后按照显示的说明操作。

  5. 在同一面板中,为关联的应用启用 Enable app discovery 选项。在 Action 经过审核和批准之前,此选项会灰显。

Google Home 的深层链接

借助深层链接,您可以从 Android 或 iOS 应用将用户直接转到 GHA 内的特定目的地,从而使用 Assistant 简化设备设置过程。

GHA 深层链接的语法如下:

https://madeby.google.com/home-app/?deeplink=destination

您的 Android 或 iOS 应用目前可以链接到 GHA 中的以下目的地:

目标 说明
setup/ha_linking?agent_id=agent-id 针对给定 smart home 操作的 agent-id 启动 OAuth 帐号关联流程

目标路径必须经过正确的网址编码,然后才能应用于深层链接。例如:

https://madeby.google.com/home-app/?deeplink=setup%2Fha_linking%3Fagent_id%3Dagent-id

如需详细了解如何在应用中触发深层链接,请参阅相关的 Android 文档iOS 文档