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

test-push-notification-sdk

v1.0.2

Published

MSG91 Push Notification SDK for react native application.

Readme

📲 MSG91 Push Notification SDK for React Native

Easily integrate in-app pop-up notifications and Firebase Cloud Messaging (FCM) notifications in your React Native app using MSG91's Push Notification SDK.

Supports:

  • 🔔 In-App HTML Pop-up Notifications
  • 📩 FCM Notifications with HTML Templates

🚀 Installation

npm install @msg91comm/react-native-push-notification-sdk react-native-webview
# or
yarn add @msg91comm/react-native-push-notification-sdk react-native-webview

For FCM push notifications also install:

npm install @react-native-firebase/app @react-native-firebase/messaging

Run pod install in the ios folder, then rebuild the native app.

Use SDK v1.0.2 or later for in-app socket popups. Older versions had a message-bridge bug that blocked foreground notifications.


📦 Requirements


💻 Basic Usage (in-app pop-up)

Important integration rules:

  1. Mount the SDK in App.tsx (root) — not inside a nested screen or navigator.
  2. Define helloConfig as a module-level constant — do not pass an inline { ... } object in JSX.
  3. unique_id must match the user you target in the MSG91 dashboard.
  4. In-app popups only work when the app is in the foreground.
import React from 'react';
import MSG91PushNotificationSDK from '@msg91comm/react-native-push-notification-sdk';

// ✅ Define outside the component — stable reference
const MSG91_HELLO_CONFIG = {
  widgetToken: 'your_widget_token',
  unique_id: '[email protected]',
};

const MSG91_PROJECT_ID = 'your_msg91_project_id';

export default function App() {
  return (
    <>
      <AppNavigator />
      <MSG91PushNotificationSDK
        helloConfig={MSG91_HELLO_CONFIG}
        projectId={MSG91_PROJECT_ID}
      />
    </>
  );
}

With this setup, your app receives in-app HTML notifications when a push is triggered via socket (app in foreground).


🔧 Firebase Setup (for FCM)

1. Generate Firebase Admin SDK Key

  • Go to your Firebase project → Project Settings > Service Accounts
  • Click Generate new private key and download the JSON file

2. Upload Firebase Key to MSG91 Dashboard

Upload the Firebase Admin JSON in the Push Notification Panel → Firebase Integration section.

3. Add google-services.json (Android)

android/app/google-services.json

4. Native configuration

Follow the React Native Firebase messaging guide for platform setup.

Android (13+): add to AndroidManifest.xml:

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

iOS: enable Push Notifications capability and add remote-notification to UIBackgroundModes in Info.plist.


🧑‍💻 Example with Firebase Messaging

import React, { useEffect } from 'react';
import messaging from '@react-native-firebase/messaging';
import MSG91PushNotificationSDK from '@msg91comm/react-native-push-notification-sdk';

const MSG91_HELLO_CONFIG = {
  widgetToken: 'your_widget_token',
  unique_id: '[email protected]',
};

const MSG91_PROJECT_ID = 'your_msg91_project_id';

export default function App() {
  useEffect(() => {
    messaging().requestPermission();

    messaging().getToken().then(token => {
      MSG91PushNotificationSDK.registerFCM(token);
    });

    messaging().onTokenRefresh(token => {
      MSG91PushNotificationSDK.registerFCM(token);
    });

    messaging().onNotificationOpenedApp(remoteMessage => {
      if (remoteMessage?.data?.key === 'msg91') {
        MSG91PushNotificationSDK.handleFCMNotification(
          remoteMessage.data.html_url as string,
        );
      }
    });

    messaging().onMessage(remoteMessage => {
      if (remoteMessage?.data?.key === 'msg91') {
        MSG91PushNotificationSDK.handleFCMNotification(
          remoteMessage.data.html_url as string,
        );
      }
    });

    messaging().getInitialNotification().then(remoteMessage => {
      if (remoteMessage?.data?.key === 'msg91') {
        MSG91PushNotificationSDK.handleFCMNotification(
          remoteMessage.data.html_url as string,
        );
      }
    });
  }, []);

  return (
    <>
      <AppNavigator />
      <MSG91PushNotificationSDK
        helloConfig={MSG91_HELLO_CONFIG}
        projectId={MSG91_PROJECT_ID}
      />
    </>
  );
}

⚙️ Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | helloConfig | object | Yes | Must include widgetToken. Optionally pass unique_id for user targeting. | | projectId | string | Yes | MSG91 project ID |


🧪 SDK Methods

| Method | Description | |--------|-------------| | MSG91PushNotificationSDK.registerFCM(fcmToken) | Register device FCM token with MSG91 | | MSG91PushNotificationSDK.handleFCMNotification(htmlUrl) | Show FCM notification as in-app pop-up |