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.
Using the Notifications panel
Section titled “Using the Notifications panel”Choosing a payload
Section titled “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
bodykey, whichexpo-notificationsreads as the notification’sdata. - 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 below), but not when it’s delivered through
expoNotifications. - Android: data-only (expo), which sets
data.titleanddata.message, the keysexpo-notificationsshows for a payload with onlydata.
Editing the payload
Section titled “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
apsobject. - Android: the payload can only have
notification,dataandandroidkeys, and needs anotificationordataobject. Every value innotificationanddatamust be a string, and so mustandroid.notification.channel_id. - Either platform: the payload can be at most 4096 bytes.
Sending
Section titled “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, it’s delivered through your app instead.
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 and the notification is delivered through your app
instead.
Saving presets
Section titled “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
Section titled “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, or pass a handler to
notificationsto deliver through your app. - The panel doesn’t keep a history of sent notifications.