home / skills / hoangnguyen0403 / agent-skills-standard / react-native-notifications
This skill helps implement push notifications in React Native apps using Firebase or Expo, handling foreground, background, and quit states.
npx playbooks add skill hoangnguyen0403/agent-skills-standard --skill react-native-notificationsReview the files below or copy the command above to add this skill to your agents.
---
name: React Native Notifications
description: Push notifications for React Native using React Native Firebase or Expo Notifications.
metadata:
labels: [react-native, notifications, fcm, push, expo, firebase]
triggers:
files: ['**/*notification*.ts', '**/*notification*.tsx', '**/App.tsx']
keywords:
[Notifications, messaging, FCM, expo-notifications, react-native-firebase]
---
# React Native Notifications
## **Priority: P1 (OPERATIONAL)**
Push notifications using React Native Firebase or Expo Notifications.
## Guidelines
- **Library**: Choose `@react-native-firebase/messaging` (Bare) or `expo-notifications` (Managed).
- **Setup**: Configure Platform channels (Android) and APNs (iOS).
- **Lifecycle**: Handle Foreground (`onMessage`), Background (`onNotificationOpenedApp`), and Quit (`getInitialNotification`) states.
- **Permissions**: Prime users before requesting system authorization.
[Implementation Details](references/implementation.md)
## Anti-Patterns
- **No Unconditional Requests**: Spamming permission dialogs leads to high denial rates.
- **No Missing Handlers**: Forgetting "Quit" state handling results in lost deep links.
- **No Unvalidated Data**: Blindly trusting payload data causes runtime crashes.
## Related Topics
react-native-navigation | react-native-dls | mobile-ux-core
This skill provides pragmatic guidance for implementing push notifications in React Native apps using either React Native Firebase (@react-native-firebase/messaging) for bare workflows or expo-notifications for managed workflows. It focuses on correct platform setup, lifecycle handling, and permission strategies to ensure reliable delivery and safe payload handling. The guidance is operational: how to wire handlers, avoid common anti-patterns, and surface deep links from all app states.
The skill inspects app configuration and runtime notification flows, emphasizing platform channels for Android and APNs setup for iOS. It maps the three core lifecycle states — foreground (onMessage), background (onNotificationOpenedApp), and quit (getInitialNotification) — and prescribes where to attach handlers, validate payloads, and route deep links. It also covers permission priming and conditional authorization requests to improve opt-in rates.
Which library should I pick for a new app?
Use expo-notifications for managed Expo projects and @react-native-firebase/messaging for bare React Native projects that need deeper native integration.
How do I ensure deep links work from closed apps?
Implement getInitialNotification on startup to inspect the notification that launched the app and route accordingly; also handle onNotificationOpenedApp for background-to-foreground transitions.