# Trigger Push Notifications

***

*Skill Level: Intermediate*

## Before You Begin

Notifications require that your app is installed on Native iOS, Android, or as a PWA.

* Notifications can only be triggered to another logged-in user, on another device.&#x20;
  * *ex: The Logged-in User triggering the notification will not be able to receive the notification they triggered within the app.*&#x20;
* Notifications only work when a user is logged in.
  * *ex: Any button or action that sends a notification works only if a user is logged in. Without a logged-in user, Adalo cannot create the required token, so the notification will not be sent.*
* The app must have the [Request Notification Permission](/actions/notifications/request-notification-permission-in-your-app.md) set up. Please ensure this is set up correctly before continuing.&#x20;
* Target Screen is only available on Native iOS and Android. PWA will always direct to the Apps Home Navigation Screen.

***

### Add Notification Action

* Select the component that should trigger the notification, then in the left panel select 'Add Action'.
* Scroll to the bottom of the options, and click Trigger Notification.

  <figure><img src="/files/f8SuVMAnWJE55EapnmAG" alt="" width="329"><figcaption></figcaption></figure>

### Select Users to receive notification

All Users will get the notification unless filtered by available data such as Current User or by a Relationship to the User.&#x20;

* **Current User - Send a message to a single user using Available Screen Data**

  * Uses include sending a notification to a single user such as a 'New Follower' notification or 'Friend Request' when **Current User** Data is available.

  <div align="left"><figure><img src="/files/yvMlJpz1Fv9StjUqpacf" alt="" width="124"><figcaption></figcaption></figure></div>
* **One User - Send a message to a single User through Filter**
  * Used similarly to "Current User" but when filtering through other available data such as a relation to a User. Example of this may be a Marketplace Listing sale or an Admin approval request.

    <div align="left"><figure><img src="/files/MyPFETCE1T00jVdDkB7j" alt="" width="188"><figcaption></figcaption></figure></div>
* **Multiple Users - All Users or Users who meet criteria**

  * Used when wanting to send to all users or a specific group of users filtered through a rerelationship. Examples would include a Notification to multiple users about an event they are attending or a new message in a group chat.&#x20;

  <div align="left"><figure><img src="/files/gpnVui0qBR9JOrMj6yzW" alt="" width="563"><figcaption></figcaption></figure></div>
* This is also where you exclude the Logged in User from your notifications if sending to multiple Users.

  <div align="left"><figure><img src="/files/iwF9nzC7FDgoG0W0YoA6" alt="" width="179"><figcaption></figcaption></figure></div>

{% hint style="info" %}

* Notifications will only be sent if;
  1. The user has the app installed on their device.
  2. The user is logged in.&#x20;
  3. The user has had activity in the app in the last 2 weeks to be considered active.
  4. The user has permissions allowed.
  5. The user is not the user triggering the notification.
     {% endhint %}

### Enter Notification Details

* Set the title and body text for the Notification message.
  * If using information from an Input, we recommend creating a Message or Notification Record in your Collections before using that information to fill in the Notification details.&#x20;

{% hint style="warning" %}
**Warning:** If the body of the Trigger Notification action is left empty, **the notification will fail on Android and Web.** Always make sure the body field is filled in to ensure notifications are delivered across all platforms.
{% endhint %}

* Select which screen in your app the user should be taken to when the tap on the notification on Native iOS and Android builds.

  * You **must** select a Screen for notification to be triggered.&#x20;

  <div align="left"><figure><img src="/files/d2hpivtUz7i9TJuh3om2" alt="" width="203"><figcaption></figcaption></figure></div>

{% hint style="warning" %}
**PWA will always direct to the Apps Home Navigation Screen regardless of the Target Screen selected.**
{% endhint %}

### Next Steps

Now you are ready to test your notifications!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.adalo.com/actions/notifications/trigger-push-notifications.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
