2
votes

I'm trying to open my deeplink by responding to app action intent. My actions.xml

<?xml version="1.0" encoding="utf-8"?>
<actions>
    <action intentName="actions.intent.RECORD_HEALTH_OBSERVATION" >
        <fulfillment urlTemplate="myapp://logMeasure{?measureName}">
            <parameter-mapping
                intentParameter="healthObservation.measuredProperty.name"
                urlParameter="measureName" />
        </fulfillment>
    </action>
</actions>

In the manifest, I've declared the MainActivity as exported and with deeplink and the meta for actions.

<activity
    android:name="com.myapp.MainActivity"
    android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data
            android:host="logMeasure"
            android:scheme="myapp"/>
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
    </intent-filter>
</activity>

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

I'm correctly logged in with the same google account on android studio and my phone. My account can access the Google Play Developer console and the app is already published.

Here is the app action test tool screenshot with the configuration. App action test tool

When I click run, the assistant open, load and then display the toast with "App isn't installed." Assistant can't open my deeplink

What am I missing?

1

1 Answers

3
votes

At a glance, everything looks properly configured. Although I do see a lint error for your android:host - "Host matching is case sensitive and should only use lower-case characters" so you should probably switch that to just lowercase. I'm not sure that's the issue though.

The "App isn't installed message" means that Assistant is unable to find an app that can satisfy the Intent built from actions.xml. Two things I would check:

  1. Try starting your Activity from command line via adb to ensure your intent-filters are set up correctly, for example:
    adb shell am start -a android.intent.action.VIEW \
            -c android.intent.category.BROWSABLE \
            -d "myapp://logMeasure?measureName=test"
  1. If that works fine, then double check that the package name of the app that handles this Intent (installed on your test device) matches the one with the actions.xml file in Android Studio. When Assistant calls your Intent it will also specify the package name to ensure another app won't intercept and handle the Intent instead. You can also test this via adb by adding the package name to the end:
    adb shell am start -a android.intent.action.VIEW \
            -c android.intent.category.BROWSABLE \
            -d "myapp://logMeasure?measureName=test" \
            com.yourpackage.from.studio.project