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

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]);
};

Options

OptionTypeDescription
filter(notification: Notification) => booleanOptional predicate run on the result.

Returns

Notification[]: every notification with the system tag, plus any that pass the optional filter.