You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

自定义播放内容Custom Actions在Assistant中测试失效求助

问题描述

我为应用开发了基于Custom Actions的播放内容功能,上传.aab包作为内部测试草稿后,Android Studio插件测试和在Google Assistant中输入「Play xxx in myapp」指令都能正常运行。但近期测试时,只有Android Studio插件的内部参数测试还能正常工作,在设备的Google Assistant中输入对应指令时该功能完全失效。

目前所有Capability运行正常,只有播放内容相关功能出现异常,该功能两周前还能正常使用,怀疑可能和Google的Custom Actions验证机制有关,希望能协助排查原因。

相关配置代码

Shortcuts配置

<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    
    <!-- capability for Search method -->
    <capability android:name="actions.intent.GET_THING">
        <intent
            android:action="android.intent.action.VIEW"
            android:targetClass="xxx.app2.ui.app.MainActivity"
            android:targetPackage="xxx">
            <parameter
                android:name="thing.name"
                android:key="q" />
        </intent>
    </capability>

    <!-- capability to open defined pages or static content -->
    <capability android:name="actions.intent.OPEN_APP_FEATURE">
        <intent
            android:targetClass="xxx.app2.ui.app.MainActivity"
            android:targetPackage="xxx">
            <parameter
                android:name="feature"
                android:key="featureParam"/>
        </intent>
    </capability>

    <capability
        android:name="custom.actions.intent.PLAY_CONTENT_INTENT"
        app:queryPatterns="@array/play_content_queries">
        <intent android:targetClass="xxx.app2.ui.app.MainActivity"
            android:targetPackage="xxx">
            <parameter
                android:name="show"
                android:key="show"
                android:mimeType="https://schema.org/Text" />
            <parameter
                android:name="episode"
                android:key="episode"
                android:mimeType="https://schema.org/Text" />
        </intent>
    </capability>

    <shortcut
        android:shortcutId="MY_SHOWS"
        android:shortcutShortLabel="@string/shortcut_short_label_my_shows"
        android:shortcutLongLabel="@string/shortcut_long_label_my_shows">
        <capability-binding android:key="actions.intent.OPEN_APP_FEATURE">
            <parameter-binding
                android:key="feature"
                android:value="@array/my_shows_names" />
        </capability-binding>
    </shortcut>

    <shortcut
        android:shortcutId="MY_ACCOUNT"
        android:shortcutShortLabel="@string/shortcut_short_label_my_account"
        android:shortcutLongLabel="@string/shortcut_long_label_my_account">
        <capability-binding android:key="actions.intent.OPEN_APP_FEATURE">
            <parameter-binding
                android:key="feature"
                android:value="@array/my_account_names" />
        </capability-binding>
    </shortcut>

    <shortcut
        android:shortcutId="PLAY_LAST"
        android:shortcutShortLabel="@string/shortcut_short_label_play_last"
        android:shortcutLongLabel="@string/shortcut_long_label_play_last">
        <capability-binding android:key="actions.intent.OPEN_APP_FEATURE">
            <parameter-binding
                android:key="feature"
                android:value="@array/play_last_names" />
        </capability-binding>
    </shortcut>
</shortcuts>

Arrays配置

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string-array name="my_shows_names">
        <item>My shows</item>
        <item>My favourites</item>
        <item>My categories</item>
        <item>My episodes</item>
        <item>My list</item>
        <item>My lists</item>
        <item>My list of shows</item>
        <item>My lists of shows</item>
        <item>My list of episodes</item>
        <item>My lists of episodes</item>
        <item>shows</item>
        <item>favourites</item>
        <item>categories</item>
        <item>episodes</item>
        <item>list</item>
        <item>lists</item>
        <item>list of shows</item>
        <item>lists of shows</item>
        <item>list of episodes</item>
        <item>lists of episodes</item>
    </string-array>

    <string-array name="my_account_names">
        <item>My account</item>
        <item>My status</item>
        <item>My configuration</item>
        <item>My config</item>
        <item>My data</item>
        <item>My settings</item>
        <item>account</item>
        <item>status</item>
        <item>configuration</item>
        <item>config</item>
        <item>settings</item>
    </string-array>

    <string-array name="play_last_names">
        <item>Play Last content</item>
        <item>Play continue watching</item>
        <item>Play last content on my list</item>
        <item>Last content</item>
        <item>continue watching</item>
        <item>Play last of my list</item>
        <item>last of my list</item>
        <item>Play last on my list</item>
        <item>last on my list</item>
        <item>last time</item>
        <item>Play My Last content</item>
        <item>Play My continue watching</item>
        <item>Play last time</item>
        <item>My Last content</item>
    </string-array>

    <string-array name="play_content_queries">
        <item>Play $show (show)?</item>
        <item>Play $episode episode in $show (show)?</item>
        <item>Play $episode episode of $show (show)?</item>
        <item>Play $show (show)? from $episode episode</item>

        <item>Resume $show (show)?</item>

        <item>Continue $show (show)?</item>
        <item>Continue watching $show (show)?</item>

        <item>Reproduce $show (show)?</item>
        <item>Reproduce $episode episode in $show (show)?</item>
        <item>Reproduce $episode episode of $show (show)?</item>
        <item>Reproduce $show (show)? from $episode episode</item>

        <item>Watch $show (show)?</item>
        <item>Watch $episode episode in $show (show)?</item>
        <item>Watch $episode episode of $show (show)?</item>
        <item>Watch $show (show)? from $episode episode</item>
    </string-array>
</resources>

内容的提问来源于stack exchange,提问作者Juan Francisco Gato Luis

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 20:59:57