Skip to main content

Send push notifications

Learn how to send push notifications to Retool Mobile users.

Retool Cloud and Self-hosted organizations can send push notifications to Retool Mobile users. Using the built-in Mobile Push Notifications resource, you write queries that send notifications to specified users from any Retool app or workflow.

Configuring push notifications is a two-part process:

  • Add a query to mobile apps that subscribe users to push notifications and enables them on their device.
  • Write queries in Retool apps and workflows to send push notifications to subscribed users.

Self-hosted deployments must also complete additional steps before using push notifications.

Subscribe users to push notifications

Each user must first subscribe to receive push notifications. This is done by adding a query to mobile apps that runs automatically whenever users launch the app. Open a mobile app in the App IDE and add a Resource query, select the Mobile Push Notifications resource, then select the Subscribe action.

You specify the topic to which the user subscribes. You can configure multiple topics, such as ALL_USERS or SALES_TEAM. You can subscribe the user to receive only direct notifications using USER:{{current_user.email}}.

When the query runs, it subscribes the user to push notifications. The mobile app also prompts the user to allow notifications on their device if they have not yet done so. Once subscribed, the user can receive notifications sent to relevant topics.

Send push notifications

The Mobile Push Notifications resource is available anywhere you can write queries in Retool. This enables you to send notifications from any app or workflow. You can send notifications to specific users by including their email addresses or to all users. You specify the recipients and message, and then configure the query to run.

Queries for the Mobile Push Notifications resource only send when used in web apps and workflows. If you need to send push notifications from a mobile app, specify the Send action.

Send queries include a Topics field in which you add recipients. Add any topics previously used to subscribe users, such as SALES_TEAM. If the user subscribed to the USER topic that included their email address, such as USER:{{current_user.email}}, use USER:jenny@example.com.

Users can only receive notifications sent for the topics to which they subscribed.

Push notifications can include deep links that, when tapped, enable users to navigate to a specific app. To include a deep link, toggle the Configure Deep Link setting on.

There are three settings to configure:

  • App: The app to launch when the notification is tapped.
  • Screen: The specific screen in the app to open. If you do not select a screen, the app's default screen is used.
  • Params: Key-value pairs to include as available parameters for the target app.
Configure deep link settings

The initialDeeplink.params object contains a list of key-value pairs for each set of deep link parameters that may have been included. For example, id=123 is available using initialDeeplink.params.id. You can reference deep link parameters anywhere in your mobile app and use them to control behavior, such as retrieving a specific user or prefilling an input field.

Configure push notifications for Self-hosted deployments

If you have a Self-hosted deployment, you must obtain a push notification API token from Retool and then configure additional environment variables.

First, contact our support team to request a token. Once you receive it, configure the following environment variables:

MOBILE_PUSH_NOTIFIER_HOST=https://spb8yl7d3j.execute-api.us-west-2.amazonaws.com
MOBILE_PUSH_NOTIFIER_API_TOKEN=(Your push notification API token)