简体   繁体   中英

app actions: work with test tool but not with voice

I am exploring the app actions. I'd like to build a demo with three pages, and the user could navigate to different pages by giving the right instruction to google assistant. here is my actions.xml and AndroidManifest.xml:

//actions.xml
<?xml version="1.0" encoding="utf-8"?>

<actions>
 <action intentName="actions.intent.OPEN_APP_FEATURE">
    <parameter name="feature">
      <entity-set-reference entitySetId="FeatureEntitySet" />
    </parameter>
    <fulfillment
        fulfillmentMode="actions.fulfillment.DEEPLINK"
        urlTemplate="http://example.com/open{?title}">
      <parameter-mapping
          intentParameter="feature"
          urlParameter="title"
          entityMatchRequired="true"/>
    </fulfillment>
  </action>

  <entity-set entitySetId="FeatureEntitySet">
    <entity name="game" identifier="game" />
    <entity name="navigation" identifier="navigation" />
    <entity name="ebook" identifier="ebook" />
  </entity-set>
</actions>

//AndroidManifest.xml

<activity android:name="com.appactiont.demo.MainActivity"
    android:exported="true">
  <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
  </intent-filter>

  <intent-filter>
    <action android:name="com.google.android.gms.actions.SEARCH_ACTION" />
    <category android:name="android.intent.category.DEFAULT" />
  </intent-filter>

  <intent-filter android:autoVerify="true" tools:targetApi="m">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data
        android:host="example.com"
        android:scheme="http" />
  </intent-filter>
</activity>

It works with app actions test tool, but google assistant cannot correctly interpret "open demo game" or "open demo with feature game" (even I type it). It just opens a search result. Not sure if I missed something in my code. Appreciated if anyone can help!

This should be fixed by now. Please try it and let me know if it's working or not. Thanks!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM