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

fgp-react-native-push-notifications

v1.0.0

Published

Native Firebase Cloud Messaging (FCM) push notifications library for React Native without Expo limits

Readme

fgp-react-native-push-notifications

Enterprise-Grade Firebase Cloud Messaging (FCM) Push & On-Device Local Notifications library for React Native and Expo. Operates without Expo Push Service limitations and fulfills Google Play 2027 Android Vitals standards.


🌟 Key Features

  • ⚡ No Expo Limitations: Uses official native Firebase Messaging SDK directly.
  • 💬 WhatsApp-Style Chat Notifications: Native MessagingStyle with sender avatars (avatar_url) and Direct Reply.
  • 🖼️ Expandable Image Banners: Asynchronous image downloading (BigPictureStyle) for rich media pushes.
  • 📞 Full-Screen Incoming Calls: Ringtone-activated Full-Screen Intent with "Accept" and "Decline" actions.
  • ⚙️ Custom Notification Channels: createChannel() with custom importance, vibration, and sounds.
  • 🌐 Topic Subscriptions: subscribeToTopic() and unsubscribeFromTopic().
  • 🔔 100% Offline Local Notifications: displayLocalNotification() for on-device alerts without a backend server or internet connection.
  • 🚀 Cold Start Payload Inspection: getInitialNotification() retrieves launch payload when opening the app from a killed state.

📦 Installation

npm install fgp-react-native-push-notifications
# or
yarn add fgp-react-native-push-notifications

⚙️ Android Configuration

1. AndroidManifest.xml Setup

Add the FCM service and Action Receiver inside your <application> tag:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />

    <application>
        <!-- FCM Native Service -->
        <service
            android:name="com.frankgp.pushnotifications.MyFirebaseMessagingService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

        <!-- Broadcast Receiver for Direct Reply & Actions -->
        <receiver
            android:name="com.frankgp.pushnotifications.PushNotificationReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="com.frankgp.pushnotifications.ACTION_CHAT_REPLY" />
                <action android:name="com.frankgp.pushnotifications.ACTION_ACCEPT_CALL" />
                <action android:name="com.frankgp.pushnotifications.ACTION_DECLINE_CALL" />
                <action android:name="com.frankgp.pushnotifications.ACTION_MARK_READ" />
                <action android:name="com.frankgp.pushnotifications.ACTION_MUTE" />
            </intent-filter>
        </receiver>
    </application>
</manifest>

2. Notification Icon Setup (app.json for Expo)

In your Expo app.json, specify your monochrome silhouette icon for Android status bar notifications:

{
  "expo": {
    "name": "MyAwesomeApp",
    "android": {
      "package": "com.example.app",
      "googleServicesFile": "./google-services.json",
      "notification": {
        "icon": "./assets/images/notification-icon.png",
        "color": "#208AEF"
      }
    }
  }
}

🚀 Usage Guide

import { PushNotification } from 'fgp-react-native-push-notifications';

// 1. Get Device FCM Registration Token
const token = await PushNotification.getFcmToken();
console.log('🔥 Device FCM Token:', token);

// 2. Create Custom Notification Channel
await PushNotification.createChannel({
  id: 'vip_alerts',
  name: 'VIP Alerts',
  description: 'High importance notification channel',
  importance: 'HIGH',
  enableVibration: true,
});

// 3. Subscribe to Public Topic
await PushNotification.subscribeToTopic('global_announcements');

// 4. Display 100% Offline Local Notification
await PushNotification.displayLocalNotification({
  title: 'Local Notification 🚀',
  body: 'Generated directly on device without server or FCM network',
  channelId: 'vip_alerts',
  data: {
    type: 'chat_message',
    sender_name: 'Ana Sofia',
    message_text: 'Hello from local notification!',
    avatar_url: 'https://i.pravatar.cc/300?img=49',
  },
});

// 5. Inspect Launch Notification Payload (Killed State)
const initialNotification = await PushNotification.getInitialNotification();
if (initialNotification) {
  console.log('🚀 App launched via push payload:', initialNotification);
}

// 6. Listen for Foreground Push Messages
PushNotification.onMessage((notification) => {
  console.log('🔔 Foreground Notification Received:', notification.title, notification.body);
});

// 7. Listen for Notification Taps
PushNotification.onNotificationOpenedApp((payload) => {
  console.log('👆 User tapped notification:', payload);
});

// 8. Listen for Direct Reply & Button Actions
PushNotification.onAction((action) => {
  console.log('🔘 Action Triggered:', action.actionId, action.replyText);
});

🧪 HTTP Testing Suite

A complete REST Client test suite is available in api_notifications.http featuring test cases for:

  • Google FCM HTTP v1 API (https://fcm.googleapis.com/v1/projects/.../messages:send)
  • WhatsApp-style chat messages with live avatar URLs
  • Full-screen incoming calls
  • Expandable image banners
  • Topic and condition-based messaging

📄 License

MIT © Frank GP