Implement comprehensive push notification systems for iOS and Android applications using Firebase Cloud Messaging and native platform services.
When to Use
Sending real-time notifications to users
Implementing user engagement features
Deep linking from notifications to specific screens
Handling silent/background notifications
Tracking notification analytics
Quick Start
Minimal working example:
import messaging from "@react-native-firebase/messaging";
import { Platform } from "react-native";
export async function initializeFirebase() {
try {
if (Platform.OS === "ios") {
const permission = await messaging().requestPermission();
if (permission === messaging.AuthorizationStatus.AUTHORIZED) {
console.log("iOS notification permission granted");
}
}
const token = await messaging().getToken();
console.log("FCM Token:", token);
await saveTokenToBackend(token);
messaging().onTokenRefresh(async (newToken) => {
await saveTokenToBackend(newToken);
});
messaging().onMessage(async (remoteMessage) => {
console.log("Notification received:", remoteMessage);
showLocalNotification(remoteMessage);
});
// ... (see reference guides for full implementation)
Reference Guides
Detailed implementations in the references/ directory:
Guide
Contents
Firebase Cloud Messaging Setup
Firebase Cloud Messaging Setup
iOS Native Setup with Swift
iOS Native Setup with Swift
Android Setup with Kotlin
Android Setup with Kotlin
Flutter Implementation
Flutter Implementation
Best Practices
✅ DO
Request permission before sending notifications
Implement token refresh handling
Use different notification channels by priority
Validate tokens regularly
Track notification delivery
Implement deep linking
Handle notifications in all app states
Use silent notifications for data sync
Store tokens securely on backend
Provide user notification preferences
Test on real devices
❌ DON'T
Send excessive notifications
Send without permission
Store tokens insecurely
Ignore notification failures
Send sensitive data in payload
Use notifications for spam
Forget to handle background notifications
Make blocking calls in handlers
Send duplicate notifications
Ignore user preferences
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: aj-geddes-useful-ai-prompts-push-notification-setup3description: Push Notification Setup4---56# Push Notification Setup78## Table of Contents910- [Overview](#overview)11- [When to Use](#when-to-use)12- [Quick Start](#quick-start)13- [Reference Guides](#reference-guides)14- [Best Practices](#best-practices)1516## Overview1718Implement comprehensive push notification systems for iOS and Android applications using Firebase Cloud Messaging and native platform services.1920## When to Use2122- Sending real-time notifications to users23- Implementing user engagement features24- Deep linking from notifications to specific screens25- Handling silent/background notifications26- Tracking notification analytics2728## Quick Start2930Minimal working example:3132```javascript33import messaging from "@react-native-firebase/messaging";34import { Platform } from "react-native";3536export async function initializeFirebase() {37 try {38 if (Platform.OS === "ios") {39 const permission = await messaging().requestPermission();40 if (permission === messaging.AuthorizationStatus.AUTHORIZED) {41 console.log("iOS notification permission granted");42 }43 }4445 const token = await messaging().getToken();46 console.log("FCM Token:", token);47 await saveTokenToBackend(token);4849 messaging().onTokenRefresh(async (newToken) => {50 await saveTokenToBackend(newToken);51 });5253 messaging().onMessage(async (remoteMessage) => {54 console.log("Notification received:", remoteMessage);55 showLocalNotification(remoteMessage);56 });5758// ... (see reference guides for full implementation)59```6061## Reference Guides6263Detailed implementations in the `references/` directory:6465| Guide | Contents |66|---|---|67| [Firebase Cloud Messaging Setup](references/firebase-cloud-messaging-setup.md) | Firebase Cloud Messaging Setup |68| [iOS Native Setup with Swift](references/ios-native-setup-with-swift.md) | iOS Native Setup with Swift |69| [Android Setup with Kotlin](references/android-setup-with-kotlin.md) | Android Setup with Kotlin |70| [Flutter Implementation](references/flutter-implementation.md) | Flutter Implementation |7172## Best Practices7374### ✅ DO7576- Request permission before sending notifications77- Implement token refresh handling78- Use different notification channels by priority79- Validate tokens regularly80- Track notification delivery81- Implement deep linking82- Handle notifications in all app states83- Use silent notifications for data sync84- Store tokens securely on backend85- Provide user notification preferences86- Test on real devices8788### ❌ DON'T8990- Send excessive notifications91- Send without permission92- Store tokens insecurely93- Ignore notification failures94- Send sensitive data in payload95- Use notifications for spam96- Forget to handle background notifications97- Make blocking calls in handlers98- Send duplicate notifications99- Ignore user preferences100101---102> Converted and distributed by [TomeVault](https://tomevault.io/claim/aj-geddes) — claim your Tome and manage your conversions.103<!-- tomevault:4.0:skill_md:2026-04-11 -->
Run npx skillmds@latest add tomevault-io/aj-geddes-useful-ai-prompts-push-notification-setup in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Push Notification Setup It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.