ronjunevaldoz/kmp-agent-skills/kmp-push-notifications
Claude Code and agent skill by ronjunevaldoz/kmp-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Push notification handling for Kotlin Multiplatform — a shared PushToken and NotificationPayload domain type in commonMain, Android FCM token registration and FirebaseMessagingService, iOS APNs token bridging to FCM, NotificationHandler expect/actual for foreground display and tap routing, and deep-link navigation from a notification tap.
Install
npx vskill@latest install ronjunevaldoz/kmp-agent-skills/kmp-push-notificationsSKILL.md
The same SKILL.md was published earlier as ronjunevaldoz/kmp-agent-skills/kmp-push-notifications.
When to Use This Skill
Use when:
- Registering for push notifications on Android (FCM) and iOS (APNs → FCM)
- Receiving the device push token and sending it to a backend
- Handling foreground notifications (show an in-app banner or dialog)
- Routing the user to a specific screen when they tap a notification
- Managing notification permission on Android 13+ (uses
Permission.PushNotifications)
Trigger keywords: push notifications, FCM, APNs, Firebase Messaging, push token, notification handler, FirebaseMessagingService, foreground notification, notification tap, deep link from notification, remote notification, KMP push, NotificationPayload, push token refresh, FCM token refresh.
Freshness rule: Firebase Messaging depends on the Firebase BoM — always use platform("com.google.firebase:firebase-bom:...") and let BoM manage individual versions. On iOS, APNs token must be bridged to FCM via Messaging.messaging().apnsToken. On Android 13+, POST_NOTIFICATIONS is a dangerous permission (see kmp-permissions skill). FCM HTTP v1 API replaced the legacy API in 2024 — update backend senders accordingly.
Recommendation First
Define PushToken and NotificationPayload in commonMain. Android handles everything in FirebaseMessagingService; iOS bridges APNs to FCM in AppDelegate. Use expect/actual NotificationHandler for showing foreground notifications — platform code shows the notification channel (Android) or UNUserNotificationCenter (iOS). Deep-link routing from a notification tap reuses the existing DeepLinkParser.
Core types — commonMain
NotificationHandler — expect/actual
Android — FCM setup
`libs.versions.toml` (BoM manages individual versions):
In androidApp/build.gradle.kts:
AndroidManifest.xml:
`AppFirebaseMessagingService.kt`:
Android `NotificationHandler.android.kt`:
Android — retrieve current FCM token on startup
iOS — APNs bridge to FCM
In AppDelegate.swift:
Android 13+ notification permission
Use Permission.PushNotifications from the kmp-permissions skill:
Testing
Platform registration (FCMonNewToken, APNsdidRegisterForRemoteNotificationsWithDeviceToken)is tested via instrumented tests on Android and XCTest on iOS. The sharedNotificationHandlerinterface covers the cross-platform logic testable incommonTest.
Common Anti-Patterns
- Sending the push token directly from `onNewToken` over the network —
onNewToken
can be called when the network is unavailable; always enqueue a WorkManager one-time job to persist and retry the token upload
- Using the legacy FCM HTTP API — the legacy send API was deprecated in June 2023 and
shut down; all backend senders must use the HTTP v1 API with OAuth 2.0 service account
- Not bridging APNs token to FCM on iOS — Firebase on iOS needs the raw APNs device
token to generate an FCM registration token; set Messaging.messaging().apnsToken in didRegisterForRemoteNotificationsWithDeviceToken
- Assuming `onMessageReceived` is called for all messages — FCM only calls
onMessageReceived
for data-only messages and notification messages when the app is in the foreground; background notification messages bypass the service and go directly to the system tray
- Hardcoded notification channel ID strings — define the channel ID as a constant and
use the same value in NotificationChannel creation and NotificationCompat.Builder
Related Skills
kmp-permissions— Android 13+POST_NOTIFICATIONSpermission is a
dangerous permission; request it using the permissions skill's PermissionController
kmp-deep-linking— notification taps route the user viaDeepLinkParser;
the same DeepLink sealed class and toRoute() extension are reused
kmp-workmanager— token upload should be a one-timeWorkManager
request so it survives process death and network unavailability
Output Style
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/kmp-push-notifications/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ronjunevaldoz/kmp-agent-skills/kmp-push-notifications)