未调用的应用程序中操作

未调用的应用程序中操作

本文介绍了内置意图“actions.intent.GET_ACCOUNT";在用户查询“Check Balance in mybank"未调用的应用程序中操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在安卓 7.2 版上测试.当用户查询从 mybank 检查储蓄余额"或检查 mybank 中的当前余额"时工作正常其中 mybank 是在 APP 动作测试工具中创建的应用名称.

Tested on android version 7.2 .Works fine when user queries "Check saving balance from mybank " or "Check current balance in mybank"where mybank is app name created in APP action test tool.

intent 被调用并且 onBindSlice 接收参数saving"和current"作为参数但是不适用于在我的银行中查询余额" 未捕获任何参数.如何使自定义用户查询起作用?

intent is called and onBindSlice receives parameter "saving" and "current" as parameter butdoes not work for "Check Balance in mybank" no parameter is captured. how can i make custom user queries work?

这是我的谷歌操作文件

<?xml version ="1.0" encoding ="utf-8"?><!--  Learn More about how to use App Actions: https://developer.android.com/guide/actions/index.html -->
<actions>
    <!--    Example Action -->
    <!--    <action intentName="Intent name (actions.intent.*)"> -->
    <!--        <action-display -->
    <!--            icon="@mipmap/..." -->
    <!--            labelTemplate="@array/..." /> -->
    <!--        <fulfillment urlTemplate="Action content URI or URL"> -->
    <!--            <parameter-mapping -->
    <!--                intentParameter="Parameter name in Intent URI" -->
    <!--                urlParameter="Parameter name in URL" /> -->
    <!--        </fulfillment> -->
    <!--    </action> -->


    <action intentName="actions.intent.GET_ACCOUNT">
        <parameter name="account.name">
            <entity-set-reference entitySetId="AccountEntitySet"/>


        </parameter>
        <entity-set entitySetId="AccountEntitySet" >

            <entity
                name="balance"

                identifier="1" />
            <entity
                name="wallet"

                identifier="2" />
            />
        </entity-set>
        <fulfillment
            fulfillmentMode="actions.fulfillment.SLICE"
            urlTemplate="content://spice.mudra.google_actions{?accountType}">
            <parameter-mapping
                urlParameter="accountType"
                intentParameter="account.name"

                required="true"/>
        </fulfillment>

        <fulfillment
            fulfillmentMode="actions.fulfillment.DEEPLINK"
            urlTemplate="https://fit-actions.firebaseapp.com/stats" />
    </action>
</actions>

清单中的代码.

<provider
            android:name=".google_actions.MySliceProvider"
            android:authorities="spice.mudra.google_actions"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.app.slice.category.SLICE" />


            </intent-filter>
        </provider>

        <meta-data
            android:name="com.google.android.actions"
            android:resource="@xml/actions" />

<activity
            android:name=".activity.SplashActivity"
            android:label="@string/app_name"
            android:exported="true"
            android:screenOrientation="portrait"
            android:theme="@style/MyMaterialTheme.Base.blue">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

            <!-- Required to support search action intents from Google Search -->
            <intent-filter>
                <action android:name="com.google.android.gms.actions.SEARCH_ACTION" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>

            <!-- Define your supported deeplinks -->
            <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="fit-actions.firebaseapp.com"
                    android:scheme="https" />
            </intent-filter>
        </activity>

推荐答案

我刚刚再次测试,它似乎与内联库存(自定义实体)一起工作.请再试一次,让我知道结果如何.

I've just tested again and it seems to be working with inline inventory(custom entities). Please try again and let me know how it goes.

这篇关于内置意图“actions.intent.GET_ACCOUNT";在用户查询“Check Balance in mybank"未调用的应用程序中操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 09:15