App Actions, why Dates and Times cannot be retrieved in Custom Intents?

57 Views Asked by At

I use a custom intent to retrieve a date or a time (both fails), but it works if I retrieve a text or a number.

Shortcuts.xml:

<capability
    android:name="custom.actions.intent.TEST"
    app:queryPatterns="@array/ExampleQueries">
    <intent>
        <url-template android:value="https://my.domain/MyTest{?Param1}" />
        <parameter
            android:name="Param1"
            android:key="Param1"
            android:mimeType="https://schema.org/Time" />
    </intent>
</capability>

the strings.xml has this entry:

<string-array name="ExampleQueries">
    <item>"repeat this time $Param1"</item>
</string-array>

I get the time value with this code:

appLinkData.getQueryParameter("Param1");

BUT the result is NULL. No Param1 is in the appLinkData. I just get my.domain/MyTest

It works with the App Actions Test Tool included in the Google Assistant plugging but it does NOT work with the real Assistant. If I set the parameter to be a TEXT or a NUMBER then it works. It only fails for DATE and TIME data types.

I tried the Android Emulator running Android 13. Android Studio version: 2022.2.1 Patch 2 Google Assistant plugin: 4.0.0 may 10, 2023

0

There are 0 best solutions below