push-notification-setup · secondsky — Claude Code skill: push on iOS, Android
A skill that walks your agent through push notification setup with Firebase Cloud Messaging and native services. Useful when you add notifications to an app or debug background messages.
npx skills add secondsky/claude-skills --skill push-notification-setup -a claude-codeWhat push-notification-setup does
The skill covers push notifications on three platforms at once. It ships working snippets: requesting permission and grabbing a device token with @react-native-firebase/messaging, handling foreground and background messages, and refreshing the token. For iOS there is Swift code using UNUserNotificationCenter and remote notification registration; for Android, a Kotlin FirebaseMessagingService with a notification channel.
A separate section lists the practices the agent will follow: ask for permission at the right moment, support Android channels, wire up deep linking, keep sensitive data out of the payload. Testing is meant for real devices, since a simulator will not show a push.
The skill assumes Firebase is already in the project. Without a configured FCM project and the native Firebase modules the snippets will not run — no token arrives. Worth checking that setup before you ask the agent to write code.
What it helps with
- request notification permission and get a device token
- handle a message that arrives in the background or with the app closed
- refresh an expired token and push the new one to your server
- create an Android notification channel
- register for remote notifications on iOS through APNs
Example prompts for the agent
- Add push notifications to my React Native app with Firebase Cloud Messaging
- Set up background message handling and token refresh
- Show me how to register a notification channel on Android
How to install push-notification-setup
1Skills CLI (Vercel)
npx skills add secondsky/claude-skills --skill push-notification-setup -a claude-code2Manually: put the files in place
~/.claude/skills/push-notification-setup/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/push-notification-setup/
1Skills CLI (Vercel)
npx skills add secondsky/claude-skills --skill push-notification-setup -a codex2Manually: put the files in place
.agents/skills/push-notification-setup/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add secondsky/claude-skills --skill push-notification-setup -a cursor2Manually: put the files in place
.cursor/skills/push-notification-setup/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install secondsky/claude-skills push-notification-setup2Manually: put the files in place
.github/skills/push-notification-setup/SKILL.md1Skills CLI (Vercel)
npx skills add secondsky/claude-skills --skill push-notification-setup -a gemini-cli2Platform CLI
gemini skills install https://github.com/secondsky/claude-skills --path plugins/push-notification-setup/skills/push-notification-setupManually: put the files in place
.devin/skills/push-notification-setup/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add secondsky/claude-skills --skill push-notification-setup -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about push-notification-setup
How do I install push-notification-setup in Claude?
Run npx skills add secondsky/claude-skills --skill push-notification-setup -a claude-code. The skill then lands in ~/.claude/skills/push-notification-setup/SKILL.md.
What does push-notification-setup do?
It helps the agent write push notification code for iOS, Android and web. Inside are JavaScript, Swift and Kotlin examples plus a list of practices for permissions, tokens and channels.
Which platforms can run this skill?
You can install it in Claude, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. GitHub Copilot uses a different command: gh skill install secondsky/claude-skills push-notification-setup.
Source text
SKILL.md · MIT
---
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.
metadata:
keywords: "push notifications, FCM, Firebase Cloud Messaging, iOS notifications, Android notifications, web notifications, React Native notifications, notification permissions, background messages, notification channels, APNS, APNs, notification tokens, remote notifications, foreground notifications, notification handlers"
license: MIT
---
# Push Notification Setup
Implement push notifications across mobile and web platforms.
## Firebase Cloud Messaging (React Native)
```javascript
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)
```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)
```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
© secondsky · MIT · secondsky/claude-skills
Similar skills
Everything for Mobile →push-notification-setup by other authors comes first.