android - 为什么 getIntent().getData() 为 getIntent() actions.intent.OPEN_APP_FEATURE 返回 null?
问题描述
我从Google 的官方文档中机械地复制了代码,以测试将 Google Assistant 操作与应用程序集成:
<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample actions.xml -->
<actions>
<action intentName="actions.intent.OPEN_APP_FEATURE">
<!-- Use url from inventory match for deep link fulfillment -->
<fulfillment urlTemplate="{@url}" />
<!-- Define parameters with inventories here -->
<parameter name="feature">
<entity-set-reference entitySetId="featureParamEntitySet"/>
</parameter>
</action>
<entity-set entitySetId="featureParamEntitySet">
<!-- Provide a URL per entity -->
<entity url="myapp://deeplink/one" name="featureParam_one"/>
<entity url="myapp://deeplink/two" name="featureParam_two"/>
</entity-set>
</actions>
以上是actions.xml的内容。App Actions Test Tool 对此很满意。当我单击运行时,应用程序已打开,但 getIntent().getData() 返回 null。
任何人都可以对此有所了解吗?
解决方案
推荐阅读
- node.js - 使用异步等待从 csv 文件创建或更新行,创建多行而不是更新
- html - 使body宽度对应于div的存在
- reactjs - React 中的状态是什么?
- android - 当表达式不适用于 onCreateDrawableState 中的枚举类时 - android、kotlin
- javascript - 在快速车把中配置文件扩展名
- css - 如何在 React 中创建平滑的背景图像过渡?
- javascript - 无法将表单数据发布到 API
- c++ - 如何将此等式转换为 C++
- swift - 合并图像和文本在swift 4中创建另一个图像
- c# - Mvc 音乐商店的更新版本或 VS2017 AspNet Core 2 的类似版本