React Native Push Notifications Without Firebase

You will have to create a free Native Notify account to get your App ID and App Token in order for the native-notify package to work. Click the "Sign Up Free" button in the top right corner of this page to create a free account.

Start Here Instructions:

These instructions show how to add Native Notify push notifications to your React Native app. After you follow these instructions, you will be able to send mass push notifications to all of your app users.

This video walks you through the Start Here Instructions below:
Expo Setup Guide:

You need the Expo modules installed in your React Native app in order for Native Notify push notifications to work. Native Notify push notifications work in both Expo "managed workflow" AND "bare workflow". You do NOT have to eject out of Expo to use Native Notify push notifications.

If you already have Expo set up in your React Native app, you can skip this 'Expo Setup Guide' and go to Step 1 below this section.

If you have not yet added Expo to your existing React Native app, visit this link to learn how to get Expo set up in your existing React Native app: https://docs.expo.dev/bare/installing-expo-modules/

Step 1:

Paste these commands into your terminal and click return:

npm install native-notify

expo install expo-device expo-notifications

Step 2:

In your App.js file, make sure this import is included at the top of the screen:

import registerNNPushToken from 'native-notify';

Step 3:

Make sure you are using a Hook function as your App function. Here is an example:

export default function App() {

     ...

}

This link explains Hooks in detail: https://reactjs.org/docs/hooks-intro.html

Step 4:

Inside of your App function, at the top of your App function, paste this code:

registerNNPushToken(your-app-id, 'your-app-token');

Step 5:

Start your Expo app:

expo start

Step 6:

Open your app in the Expo Go app on your iOS phone or Android phone.

Step 7:

Send yourself a push notification from the NativeNotify.com push notification portal.

Article Author Photo

TJ McCarty

Founder of Native Notify