react-native-push-notification
React Native Local and Remote Notifications
A React Native library that adds local and server-pushed notification support for iOS and Android apps, though it is no longer actively maintained and the author recommends checking for alternatives before adopting it.
This library adds push notification support to React Native mobile apps on both iOS and Android. Push notifications are the alerts and banners that apps display on a phone even when the app itself is not open. This package handles both local notifications (ones your app schedules and fires from the device itself) and remote notifications (ones sent from a server to the device through a notification service).
The repository is no longer actively maintained. The author states this directly in the README, citing lack of time and the growing complexity of notification handling on both platforms. Anyone starting a new project should check for alternative libraries before relying on this one.
For developers who still want to use it, installation involves adding the package via npm or yarn. On iOS, it requires additional setup through a companion Apple-specific package. On Android, the setup involves editing a configuration file called AndroidManifest.xml by hand, adding permissions for things like vibration and receiving notifications after the phone restarts. If the app also needs remote notifications pushed from a server, it requires a Google service called Firebase to be configured in the project.
The library provides a JavaScript API that the app uses to schedule notifications, cancel them, set what sound or icon they show, and respond to when a user taps one. There are separate handling paths for when the app is open versus closed. A common setup mistake noted in the README is calling the configuration function inside a component rather than at the app entry point, which causes notification handlers to not fire.
Version 7.x is the current release. A changelog is available in the repository for anyone tracking what changed between versions.
Where it fits
- Schedule a local notification that fires at a specific time from within a React Native app
- Receive and display push notifications sent from your server to Android users via Firebase
- Handle what happens when a user taps a notification while the app is closed versus open
- Customize notification sound, icon, and vibration for an Android React Native app