npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@teincfood/rn-notifications

v0.2.0

Published

React Native notification library for TeincFood — handles FCM push, Notifee, expo-notifications, badge sync, channels, tap handling, and push token registration out of the box.

Downloads

96

Readme

@teincfood/rn-notifications

React Native notification library for TeincFood — handles FCM push, Notifee, expo-notifications, badge sync, channels, tap handling, and push token registration out of the box.

Installation

npm install @teincfood/rn-notifications

Peer dependencies

Ensure the following are installed in your project:

  • expo >= 52
  • @notifee/react-native >= 9
  • @react-native-firebase/app >= 21
  • @react-native-firebase/messaging >= 21
  • expo-crypto >= 12
  • expo-live-activity >= 0.4
  • expo-notifications >= 0.28
  • react >= 18
  • react-native >= 0.72

Expo config plugin

Add to your app.config.js:

plugins: [
  "@teincfood/rn-notifications",
  // ... other plugins
]

The plugin automatically configures:

  • expo-notifications with 9 notification sounds
  • @react-native-firebase/app (static frameworks)
  • @react-native-firebase/messaging (static frameworks)
  • expo-live-activity
  • Notifee Android Maven repo
  • Android notification permissions (POST_NOTIFICATIONS, WAKE_LOCK, RECEIVE_BOOT_COMPLETED)
  • iOS remote-notification background mode
  • Firebase manifest replacements for Android

Usage

1. Setup

Call setupNotifications once in your root _layout.tsx:

import { setupNotifications } from '@teincfood/rn-notifications';
import type { PushNotificationData, NotificationAction } from '@teincfood/rn-notifications';
import { api } from './services/api.service';

setupNotifications({
  httpClient: api,
  appType: 'buyer', // 'buyer' | 'business' | 'admin'
  navigateToRoute: (route: string) => router.push(route),
  onNotificationTapped: (payload: PushNotificationData) => {
    // optional custom tap handling
  },
  onActionPress: (action: NotificationAction, payload: PushNotificationData) => {
    // handle notification action button press
  },
});

2. Hooks

import {
  useNotificationsList,
  useUnreadCount,
  useNotificationsMutations,
  useNotificationsStream,
} from '@teincfood/rn-notifications';

// Fetch notifications
const { data, isLoading } = useNotificationsList();

// Get unread count
const { data: unreadCount } = useUnreadCount();

// Mutations (plain async functions — use try/catch or .catch)
const { markAsRead, markAllAsRead, removeNotification, clearAll } = useNotificationsMutations();

// Real-time stream (connect your app's events service to trigger refetch)
const { refetch } = useNotificationsList();
useNotificationsStream(
  (cb) => {
    const disconnect = eventsService.connect(userId);
    const unsub = eventsService.on('notification_created', () => {
      cb(); // triggers the stream
      refetch(); // re-fetch notifications
    });
    return () => { unsub(); disconnect(); };
  },
  isAuthenticated,
);

3. Notification sounds

9 .wav sounds are bundled and automatically configured by the Expo config plugin:

  • notification_default.wav
  • order_new.wav
  • order_status.wav
  • order_alert.wav
  • order_complete.wav
  • order_cancelled.wav
  • rider_pickup.wav
  • rider_opportunity.wav
  • timer_alert.wav

API

setupNotifications(options: SetupOptions)

Initializes the notification system. Options:

| Option | Type | Required | Description | |--------|------|----------|-------------| | httpClient | HttpClient | Yes | HTTP client for API calls | | appType | 'buyer' \| 'business' \| 'admin' | Yes | App type for token registration | | navigateToRoute | (route: string) => void | No | Navigation callback on tap | | onNotificationTapped | (payload: PushNotificationData) => void | No | Custom tap handler | | onActionPress | (action: NotificationAction, payload: PushNotificationData) => void | No | Action button press handler |

NotificationsClient

Class with methods:

  • getNotifications() — fetch notification list
  • getUnreadCount() — fetch unread count
  • markAsRead(id) — mark single notification as read
  • markAllAsRead() — mark all as read
  • removeNotification(id) — remove a notification
  • dismissAction(id) — dismiss a notification action
  • clearAll() — clear all notifications
  • syncBadge() — sync native badge with server count
  • clearBadge() — clear native badge
  • getPreferences() / updatePreferences(prefs) — notification preferences

Global singleton managed via setGlobalClient(client) / getGlobalClient().

License

MIT