如何使用自定义单词从谷歌助手启动我们安装的应用程序

Dev*_*eva 5 android deep-linking google-assistant-sdk app-actions google-assistant

我想使用自定义单词从 Google Assistant 打开我安装的应用程序。

说“好的 Google,打开 MYAPP -> 我们不需要代表您执行任何操作。Google Assistant 将打开该应用程序。

说“好的 Google,一些词(嘿 MyAppName) -> 现在我想打开我安装的应用程序。可以使用应用程序操作/对话框流吗?

我尝试过下面的代码但不适合我

 <action intentName="custom.actions.intent.HEY_PRINTER" queryPatterns="@arrays/ExampleQueries1">
        <!-- Define parameters -->
        <!-- Define fulfillment -->
        <fulfillment
            fulfillmentMode="actions.fulfillment.DEEPLINK"
            urlTemplate="https://fit-actions.firebaseapp.com/stats" />

    </action>

<string-array name="ExampleQueries">
    <item>Hey printer</item>
</string-array>
Run Code Online (Sandbox Code Playgroud)

预期: 说“OK Google,Hey Printer -> 我想触发“custom.actions.intent.HEY_PRINTER”,以便我的应用程序打开。

任何人都可以建议这个

小智 0

恐怕这行不通。根据官方文档:

当为自定义意图提供查询模式时,期望每个模式都遵循显式调用,例如“打开ExampleApp和”或“启动ExampleApp和”。例如,考虑以下用户查询:

  • “嘿 Google,打开 ExampleGameApp 并开始制作蛋糕。”
  • “嘿 Google,打开 ExampleGameApp 并开始制作苹果派。”
  • “嘿 Google,启动 ExampleGameApp 并制作 5 个蛋糕项目。”
  • “嘿 Google,使用 ExampleGameApp 制作蛋糕 5 次。”