import { useEffect } from "react";
import { useSystemNotifications } from "stream-chat-react-native";
const useSystemNotificationLogger = () => {
const notifications = useSystemNotifications();
useEffect(() => {
const last = notifications[notifications.length - 1];
if (!last) return;
logger.log(last.severity, last.message, { emitter: last.origin.emitter });
}, [notifications]);
};useSystemNotifications
useSystemNotifications returns notifications tagged as system, those emitted via addSystemNotification. System notifications never appear in the snackbar; they're meant for analytics, dev warnings, background-sync errors, or anything else that should be observable in code but not visible to end users.
Usage
Options
| Option | Type | Description |
|---|---|---|
filter | (notification: Notification) => boolean | Optional predicate run on the result. |
Returns
Notification[]: every notification with the system tag, plus any that pass the optional filter.