App Actions

App Actions let users launch specific features in your app using the Google Assistant. By enabling App Actions to extend your app, users can easily deep link into your apps via the Assistant by simply speaking a request to the Assistant. If the user has your app already installed, the Assistant triggers deep linking when users say an invocation phrase that includes your app name, such as ”OK Google, order a vanilla marshmallow smore from smores app”.

A user asks the Assistant to order a pizza from a restaurant.
Figure 1. Invoking an App Action via the Assistant.
A phone displays an in-app page for ordering pizza.
Figure 2. The App Action deep links into the app.

To enable App Actions, you add an actions.xml file to your Android app project that tells Google what built-in intents your app supports. For some use cases, you can also build Android Slices and associate them in your actions.xml file.

Data flows between the user, the Google Assistant, and your Android
            app through fulfillments and intents.
Figure 3. Example App Actions user query flow.

The App Actions feature is supported on Android 5 (API level 21) and higher. Users can only access App Actions on Android phones.

Start building Try the sample

Key features and capabilities

The Actions on Google platform supports these key features and capabilities for App Actions.

Deep linking into Android apps

App Actions can take users directly to specific content in your app by using Android deep links , which you specify using intent filters in the Android app manifest.

For App Actions, we recommend you support deep linking with App Links , which digitally associates HTTP/HTTPS URLs with apps and websites you own.

Android Slice triggering

Users can invoke App Actions to launch Android Slices. This lets them perform focused tasks using UI from your app, which is presented through the Assistant.

We recommend that you use Slices to respond to users directly on the Assistant when they want a quick inline answer or a simple confirmation. To learn more, see Integrate App Actions with Android Slices.

Built-in intents for app categories

App Actions are triggered on pre-defined user query patterns associated with built-in intents for a select group of app categories, including food ordering, ride sharing, fitness, and finance.

These intents model some of the common ways that users express something they are trying to do, such as ordering a meal, booking a ride, or making a payment request. For App Actions, custom intents and grammars are not supported.

App Actions test tool

The test tool plugin for Android Studio creates a preview of your App Actions for a single Google account.

The plugin parses your actions.xml and fills in default values for the relevant built-in intent parameters. By modifying these values, you can test your App Actions with parameter combinations and ensure they provide the correct result.

Understand how it works

From a user's perspective, App Actions behave like shortcuts to parts of your Android app.

The Assistant responds to a food ordering query with an Android
Figure 4. Invoking an App Action to launch a Slice.

When users invoke an App Action, the Assistant either launches a screen in the Android app that the user has already installed or shows an embedded visual card (Android Slice) that users can interact with.

For example, the user could say "Hey Google, order a ride to SFO with MyRideshare" to launch the MyRideshare app. The user could later say "Hey Google, when is MyRideShare cab arriving?" and the Assistant would display an Android Slice showing the ride's expected arrival time and a suggestion chip to optionally open the app.

Internally, when a user's query matches the built-in intent grammar, the Assistant extracts the query parameters into entities and generates an Android deep link URL using the mappings you provide through the actions.xml file. Actions on Google then uses the deep link URL, prefilled with user-supplied parameters, to take users directly to specific content in your Android app without additional conversational dialog.

Implementation path

1 Support deep links in your app

Choose which Activities or Slices in your Android app make sense to be accessed using App Actions.

Ensure the activities can be accessed via deep link URLs by testing in isolation.

Then, review Implement built-in intents for App Actions to map the parameters to your deep links.

2 Tell the Assistant how to use your app

Create an actions.xml file to describe to the Assistant how to utilize your deep links and how to map parameters.

You can optionally specify inline inventory to map parameter types in your actions.xml with identifiers in your app.

3 Optimize your app for the Assistant

Before deploying your App Actions, you need to perform some additional steps to help Google better determine whether to send users to your app and to fallback gracefully in case of issues. These steps include reporting App Action interaction results via Firebase, and handling the ACTION_SEARCH Android intent.

To learn more about these steps, see App Actions deployment requirements.

4 Test and deploy

Install and use the App Actions test tool in Android Studio to test that your App Actions work. You must first create a draft in the Google Play console if your app is not published yet.

Finally, complete the deployment request form and upload your APK that contains the actions.xml to the Google Play console as normal for publishing. (The App Actions review will not affect your Android app review and deployment status in Google Play.)

Next steps