mcpField
P
push-notification-setup

push-notification-setup

github.com/aj-geddesDevelopment373577 installsUpdated 34w ago
Repository

About push-notification-setup

A practical skill for building push-notification systems in iOS and Android apps with Firebase Cloud Messaging and native platform services. It covers setup and handling patterns for developers implementing user notifications.

Key features

  1. 01Firebase Cloud Messaging setup
  2. 02iOS and Android implementation guides
  3. 03Flutter implementation guide
  4. 04Permission and token handling
  5. 05Deep links and background notifications

Use cases

  1. 01Adding real-time notifications to an app
  2. 02Opening specific screens from notifications
  3. 03Handling silent notifications for data sync
  4. 04Tracking delivery and notification preferences

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill push-notification-setup

After installing, type/push-notification-setupin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
android-setup-with-kotlin.md
firebase-cloud-messaging-setup.md
flutter-implementation.md
ios-native-setup-with-swift.md
scripts/
validate-api.sh
templates/
api-scaffold.yaml

Details

From the project README

Push Notification Setup

Table of Contents

Overview

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:

GuideContents
Firebase Cloud Messaging SetupFirebase Cloud Messaging Setup
iOS Native Setup with SwiftiOS Native Setup with Swift
Android Setup with KotlinAndroid Setup with Kotlin
Flutter ImplementationFlutter 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

Comments

Markdown supported