# Notifications

> Show notifications sent from the desktop app through your app's own handling on Android. It is off until you pass a handler.

The Notifications panel sends a push notification to your app on an iOS Simulator or Android emulator. On Android, it can also deliver it through your app’s notification handling when the FCM broadcast can’t reach the app.

[Setting up Notifications in the SDK](/docs/sdk/notifications/)

## Using the Notifications panel

### Choosing a payload

Pick a starting payload from **Choose a template…**. It lists the **Templates** for the connected app’s platform, then your **Saved presets**. When an app on the other platform connects, the editor switches to its preset with the same name, or to that platform’s default template.

iOS templates:

* **Custom data** (the default). Your custom data goes under the top-level `body` key, which `expo-notifications` reads as the notification’s `data`.
* **Basic alert**, **Alert with subtitle**, **Badge only**, **Alert with sound**, **Silent background push** and **Actionable (category)**.
* **Rich (image)**. The image only shows if your app has a Notification Service Extension that adds it.

Android templates:

* **Android: custom data** (the default).
* **Android: basic notification** and **Android: with channel**.
* **Android: with image**. The image shows when the notification is sent over adb (see [Sending over adb](#sending) below), but not when it’s delivered through `expoNotifications`.
* **Android: data-only (expo)**, which sets `data.title` and `data.message`, the keys `expo-notifications` shows for a payload with only `data`.

### Editing the payload

The payload is edited as JSON. **Format JSON** (`Shift`+`Option`+`F`, or `Shift`+`Alt`+`F` on Windows and Linux) tidies it. While the payload is invalid, the problem is shown under the editor and you can’t send or save it:

* **iOS**: the payload needs an `aps` object.
* **Android**: the payload can only have `notification`, `data` and `android` keys, and needs a `notification` or `data` object. Every value in `notification` and `data` must be a string, and so must `android.notification.channel_id`.
* Either platform: the payload can be at most 4096 bytes.

### Sending

Click **Send to device**. It’s disabled until an app is connected. Hover it to see which app and device the notification goes to.

* **iOS**: the notification is pushed to the app on the booted iOS Simulator.
* **Android**: the notification is sent to the app’s Firebase Cloud Messaging receiver over adb. If that fails and your app passes a handler to [`notifications`](/docs/sdk/notifications/), it’s delivered through your app instead.

Sending over adb

The emulator must use a **Google APIs** system image, since **Google Play** images don’t allow the root access the broadcast needs. Your app must also include Firebase Cloud Messaging, which `expo-notifications` does on Android. If either is missing, pass a handler to [`notifications`](/docs/sdk/notifications/) and the notification is delivered through your app instead.

### Saving presets

Click **Save as preset**, enter a **Preset name** and click **Save**. Presets are saved per platform. Saving with the name of an existing preset, in any case, replaces it.

Select a preset and click **Delete preset** to delete it. The editor, your presets and the selected one are kept when you close the app.

## Limits and Troubleshooting

* iOS notifications can only go to an iOS Simulator, not a physical device.
* **“Couldn’t run xcrun.”**: install Xcode and its command line tools.
* **“No iOS Simulator is booted.”**: boot one, with your app running on it.
* **“Couldn’t run adb.”**: install the Android platform tools.
* **“The device hasn’t authorised this computer.”**: accept the USB debugging prompt on the device.
* **“This emulator image doesn’t allow root, which the FCM broadcast needs.”** or **“… has no FCM receiver to take the broadcast.”**: see [Sending over adb](/docs/desktop/notifications/#sending), or pass a handler to [`notifications`](/docs/sdk/notifications/) to deliver through your app.
* The panel doesn’t keep a history of sent notifications.
