Skip to main content

Notifications Module

Quick Answer

The notifications module lives in src/core/notifications. It renders in-app notification lists and reads notification records from the active backend. It is separate from native push notification setup, but most production apps use both together.

Use the Push Notifications docs for APNs/FCM setup. Use this page when changing the notification UI or the data module that displays notifications inside the app.

Source Map

src/core/notifications
|-- IMNotificationScreen
|-- Notification
|-- firebase/notification.js
|-- redux
`-- index.js

Important pieces:

File or folderPurpose
IMNotificationScreenFull screen notification list.
Notification/IMNotificationItem.jsIndividual notification row UI.
firebase/notification.jsFirebase notification read/write helper.
reduxNotification state for apps that use Redux.
index.jsPublic module exports.

Native Push vs In-App Notifications

There are two related layers:

LayerPurpose
Native pushAPNs/FCM delivery to the device lock screen or notification center.
In-app notificationsApp UI that lists notification records after the user opens the app.

Native push can work even if the in-app notification list is empty, and the in-app list can show database records even if push delivery is not configured. Test both.

Firebase Requirements

For Firebase-backed apps:

  • Firebase Messaging must be configured for push delivery.
  • Firestore should store notification records if the app shows an in-app list.
  • Rules should prevent users from reading another user's notification feed.
  • Functions that create notifications should validate sender, recipient, and object IDs.

Verification Checklist

Test:

  • notification list opens;
  • empty state appears when there are no notifications;
  • current user's notifications load;
  • another user's notifications are not readable;
  • tapping a notification navigates correctly if deep linking is supported;
  • push arrives in foreground, background, and killed states;
  • notification records do not grow without retention or cleanup strategy.

Troubleshooting

ProblemFix
Push arrives but list is emptyCheck Firestore notification records and the in-app notification query.
List loads foreverReturn an empty state on listener errors and inspect Firestore rules.
User sees another user's notificationsTighten Firestore rules and query by authenticated user ID.
Tapping notification opens wrong screenCheck notification payload shape and navigation mapping.
Push does not arriveFollow the platform-specific push notification guides.