Skip to content
OpenSmartRoute
Skillv1.0.0

push-notification-setup

Implements push notifications across iOS, Android, and web using Firebase Cloud Messaging and native services. Use when adding notification capabilities, handling background messages, or setting up no

by secondsky(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from secondsky/claude-skills (plugins/push-notification-setup/skills/push-notification-setup/SKILL.md) via skills.sh. Install upstream with npx skills add secondsky/claude-skills --skill push-notification-setup. Copyright stays with the author (MIT).

Push Notification Setup

Implement push notifications across mobile and web platforms.

Firebase Cloud Messaging (React Native)

import messaging from '@react-native-firebase/messaging';

// Request permission
async function requestPermission() {
  const status = await messaging().requestPermission();
  if (status === messaging.AuthorizationStatus.AUTHORIZED) {
    const token = await messaging().getToken();
    await sendTokenToServer(token);
  }
}

// Handle foreground messages
messaging().onMessage(async message => {
  console.log('Foreground message:', message);
  showLocalNotification(message);
});

// Handle background/quit messages
messaging().setBackgroundMessageHandler(async message => {
  console.log('Background message:', message);
});

// Handle token refresh
messaging().onTokenRefresh(token => {
  sendTokenToServer(token);
});

iOS Native (Swift)

import UserNotifications

func requestAuthorization() {
    UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { granted, error in
        if granted {
            DispatchQueue.main.async {
                UIApplication.shared.registerForRemoteNotifications()
            }
        }
    }
}

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    let token = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()
    sendTokenToServer(token)
}

Android (Kotlin)

class MyFirebaseService : FirebaseMessagingService() {
    override fun onNewToken(token: String) {
        sendTokenToServer(token)
    }

    override fun onMessageReceived(message: RemoteMessage) {
        message.notification?.let {
            showNotification(it.title, it.body)
        }
    }

    private fun showNotification(title: String?, body: String?) {
        val channelId = "default"
        val notification = NotificationCompat.Builder(this, channelId)
            .setContentTitle(title)
            .setContentText(body)
            .setSmallIcon(R.drawable.ic_notification)
            .build()

        NotificationManagerCompat.from(this).notify(0, notification)
    }
}

Best Practices

  • Request permission at appropriate time
  • Handle token refresh
  • Support notification channels (Android)
  • Implement deep linking
  • Never send sensitive data in payload
  • Test on real devices

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/secondsky-claude-skills-push-notification-setup/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

secondsky-claude-skills-push-notification-setup.ocm.jsonjson
{
  "ocm": "1",
  "id": "secondsky-claude-skills-push-notification-setup",
  "kind": "skill",
  "name": "push-notification-setup",
  "description": "Implements push notifications across iOS, Android, and web using Firebase Cloud Messaging and native services. Use when adding notification capabilities, handling background messages, or setting up notification channels.",
  "publisher": "secondsky",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "push",
      "notifications",
      "fcm",
      "firebase",
      "cloud",
      "messaging",
      "ios",
      "android",
      "web"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Implements push notifications across iOS, Android, and web using Firebase Cloud Messaging and native services. Use when adding notification capabilities, handling background messages, or setting up notification channels."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/secondsky/claude-skills",
      "path": "plugins/push-notification-setup/skills/push-notification-setup/SKILL.md",
      "ref": "HEAD",
      "url": "https://www.skills.sh/secondsky/claude-skills/push-notification-setup",
      "key": "secondsky/claude-skills/plugins/push-notification-setup/skills/push-notification-setup/SKILL.md"
    },
    "license": "MIT"
  },
  "instructions": "# Push Notification Setup\n\nImplement push notifications across mobile and web platforms.\n\n## Firebase Cloud Messaging (React Native)\n\n```javascript\nimport messaging from '@react-native-firebase/messaging';\n\n// Request permission\nasync function requestPermission() {\n  const status = await messaging().requestPermission();\n  if (status === messaging.AuthorizationStatus.AUTHORIZED) {\n    const token = await messaging().getToken();\n    await sendTokenToServer(token);\n  }\n}\n\n// Handle foreground messages\nmessaging().onMessage(async message => {\n  console.log('Foreground message:', message);\n  showLo",
  "cost": {
    "context_tokens": 603
  }
}

Fetch it by URL: GET /api/v1/registry/secondsky-claude-skills-push-notification-setup/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.