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

@natify/push-notification-firebase

v1.0.2

Published

Push Notification adapter using @react-native-firebase/messaging

Readme

@natify/push-notification-firebase

Push Notifications adapter using @react-native-firebase/messaging to receive remote notifications and handle FCM tokens.

Note: This adapter focuses on remote notifications. To display local notifications, use @natify/push-notification-notifee.

Installation

pnpm add @natify/push-notification-firebase @react-native-firebase/messaging

iOS

  1. Configure Firebase in your iOS project (add GoogleService-Info.plist)
  2. Install pods:
cd ios && pod install

Android

  1. Configure Firebase in your Android project (add google-services.json)
  2. Configure android/app/build.gradle:
apply plugin: 'com.google.gms.google-services'

Usage

import { FirebasePushAdapter } from '@natify/push-notification-firebase';
import { NatifyApp } from '@natify/core';

const pushAdapter = new FirebasePushAdapter();

const adapters = {
  pushNotification: pushAdapter,
  // ... other adapters
};

<NatifyApp adapters={adapters} modules={modules} />

Features

  • ✅ Remote notifications (FCM)
  • ✅ FCM/APNS tokens
  • ✅ Event handling (received, pressed, token refresh)
  • ✅ Notification permissions
  • ❌ Local notifications (use @natify/push-notification-notifee)
  • ❌ Notification channels (use @natify/push-notification-notifee)

Example

import { useAdapter } from '@natify/core';
import { PushNotificationPort } from '@natify/core';

function MyComponent() {
  const push = useAdapter<PushNotificationPort>('pushNotification');

  // Request permissions and get token
  const setupPush = async () => {
    const granted = await push.requestPermission();
    if (granted) {
      const token = await push.getToken();
      console.log('FCM Token:', token?.token);
      
      // Send token to server
      await fetch('/api/register-device', {
        method: 'POST',
        body: JSON.stringify({ token: token?.token }),
      });
    }
  };

  // Listen when a remote notification is received
  useEffect(() => {
    const unsubscribe = push.onNotificationReceived(notification => {
      console.log('Remote notification received:', notification);
      // To display the notification locally, use @natify/push-notification-notifee
    });
    return unsubscribe;
  }, [push]);

  // Listen when a notification is pressed
  useEffect(() => {
    const unsubscribe = push.onNotificationPressed(notification => {
      console.log('Notification pressed:', notification);
      // Navigate to a specific screen
    });
    return unsubscribe;
  }, [push]);

  // Listen when token is refreshed
  useEffect(() => {
    const unsubscribe = push.onTokenRefresh(token => {
      console.log('Token refreshed:', token.token);
      // Update token on server
    });
    return unsubscribe;
  }, [push]);
}

Combining with Notifee

To display local notifications when receiving remote notifications, you can use both adapters:

import { FirebasePushAdapter } from '@natify/push-notification-firebase';
import { NotifeePushAdapter } from '@natify/push-notification-notifee';

const firebaseAdapter = new FirebasePushAdapter();
const notifeeAdapter = new NotifeePushAdapter();

// Listen to remote notifications and display them locally
firebaseAdapter.onNotificationReceived(async (notification) => {
  // Display using Notifee
  await notifeeAdapter.displayNotification(notification);
});

const adapters = {
  pushNotification: firebaseAdapter, // For tokens and remote notifications
  pushNotificationLocal: notifeeAdapter, // For local notifications
};

Firebase Configuration

iOS

  1. Download GoogleService-Info.plist from Firebase Console
  2. Add it to ios/Examples/GoogleService-Info.plist

Android

  1. Download google-services.json from Firebase Console
  2. Add it to android/app/google-services.json
  3. Add plugin in android/build.gradle:
buildscript {
  dependencies {
    classpath 'com.google.gms:google-services:4.4.0'
  }
}