Kotlin Multiplatform push notifications: a complete guide 2026
Learn how to implement Kotlin Multiplatform push notifications for Android and iOS using Firebase Cloud Messaging and APNs.
Posted by
Related reading
Kotlin Multiplatform image loading with Coil 3 in 2026
Learn how to load and cache images in Kotlin Multiplatform using Coil 3 with this comprehensive guide for Compose Multiplatform.
Kotlin Multiplatform in-app purchases with RevenueCat
Learn how to implement in-app purchases and subscriptions in your Kotlin Multiplatform app using RevenueCat with our step-by-step guide.
From idea to App Store in weeks: how I built Snappit with KMPShip
A real-world case study of building a cross-platform video journaling app for Android and iOS using Kotlin Multiplatform and KMPShip. See exactly what's possible when you ship faster.
- Kotlin Multiplatform supports push notifications for both Android and iOS.
- Use the expect/actual pattern for platform-specific APIs.
- KMPShip includes pre-configured push notification support in starter tiers.
How do you handle push notifications in shared Kotlin code?
Setting up Firebase Cloud Messaging for Android
- Add FCM to your project: Include the Firebase BoM in your
build.gradle:groovyimplementation platform('com.google.firebase:firebase-bom:30.3.1') implementation 'com.google.firebase:firebase-messaging' - Configure Firebase: Download the
google-services.jsonfile from the Firebase Console and place it in yourappdirectory. - Request permissions: Use the following code snippet to request notification permissions:
kotlin
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { val channel = NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_DEFAULT) notificationManager.createNotificationChannel(channel) } - Handle messages: Override the
onMessageReceivedmethod in yourFirebaseMessagingServiceto handle incoming messages.
Setting up APNs for iOS
- Enable push notifications: Go to your app's capabilities in Xcode and enable push notifications.
- Register for remote notifications: Add this code to your AppDelegate:
swift
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { granted, error in if granted { DispatchQueue.main.async { UIApplication.shared.registerForRemoteNotifications() } } } - Handle token and messages: Implement the
didRegisterForRemoteNotificationsWithDeviceTokenmethod to handle device tokens and send them to your backend.
Push notification setup: Android (FCM) vs iOS (APNs) in KMP
| Feature | Android (FCM) | iOS (APNs) |
|---|---|---|
| Setup Process | Requires Firebase Console | Requires Xcode capabilities |
| Permissions | Request permissions at runtime | User grants permissions |
| Notification Channels | Required for Android Oreo+ | Not applicable |
| Background Handling | Automatically delivered | Requires AppDelegate setup |
| Payload Format | JSON | JSON |
How do you manage notification channels on Android?
- Create a channel: When your app starts, create notification channels depending on your requirements.
- Assign notifications to channels: Specify the channel ID when building your notification.
Example of creating a notification channel
kotlinval channel = NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH) channel.description = CHANNEL_DESCRIPTION notificationManager.createNotificationChannel(channel)
How do you handle permissions for notifications on both platforms?
Permission request flow
- Android: On Android, check if the notification permission is granted and request it if not.
- iOS: On iOS, simply request permission during the app launch or when you need to send notifications.
How do you handle deep linking from notifications?
- Define a URL scheme: Set up a URL scheme in both Android and iOS.
- Handle the URL: When a user taps a notification, parse the URL and navigate to the appropriate screen.
Example of deep linking handling in Android
kotlinval intent = Intent(this, YourActivity::class.java).apply { data = Uri.parse(
Build your KMP app faster
Skip the setup and start shipping with a production-ready Kotlin Multiplatform starter kit.