This repository provides a working example of implementing Live Update Notifications on Android 16 ( Android U). It demonstrates how to leverage both Firebase Cloud Messaging (FCM) and local notifications to deliver rich, timely updates to the user.
- 🔔 Live Notifications support on Android 16
- ☁️ Firebase Cloud Messaging integration
- 📦 Payload handling and dynamic content updates
- 📱 Local notification example to simulate live updates without a backend
- 💡 Best practices for targeting Android 16+ notification behavior
- Sample app written in Kotlin
- Firebase integration (with sample payload format)
- Notification channel setup and management
- Code examples to create/update live notifications
- Target SDK 36 (Android 16)
- Firebase project (for push notifications)
- Go to Firebase Console and create a new project (or use an existing one).
- Add an Android app to the Firebase project using your app’s package name.
- 💡 Tip: You can change the application ID (package name) in build.gradle to match your preferred namespace (e.g., com.yourname.app).
- Download the google-services.json file and place it in the /app directory.
- Enable Firebase Cloud Messaging (FCM) in the Firebase Console under Build > Cloud Messaging.
- Launch the app and tap the "Get FCM Token" button:
- The token will be shown in a toast and logged in Logcat
- Copy this token for sending test messages
- Connect a physical device or use an emulator running Android 16
- Press Run in Android Studio to build and install the app
🔹 Option A: Test with Local Notification
- Tap the "Send Local Notification" button in the app
- It creates a live progress notification based on a local NotificationModel instance
🔹 Option B: Test with Firebase Console
- Go to Firebase Console > Cloud Messaging > Send Your First Message
- Enter a title and body (these will be overridden by data payload)
- Open Advanced options → Data
- In the Target section, select Single Device
- Paste the FCM token from the app
- Add the following key-value pairs:
{
"title": "Live Update Remote Title",
"body": "Live Update Remote Body",
"currentProgress": "80",
"currentProgressSegmentOne": "33",
"currentProgressSegmentTwo": "33",
"currentProgressSegmentThree": "33",
"currentProgressSegmentFour": "33",
"currentProgressPointOne": "33",
"currentProgressPointTwo": "66",
"currentProgressPointThree": "99"
}
-
Click Send Message
📌 The payload demonstrates segmented and point-based progress tracking in a live notification, perfect for use cases like order tracking, fitness goals, or download status.
Target SDK version: 36
Minimum SDK version: 29
Kotlin version: 2.1.21
Gradle version: 8.10.1
https://developer.android.com/about/versions/16/features/progress-centric-notifications
https://github.com/android/platform-samples/tree/main/samples/user-interface/live-updates
https://developer.android.com/develop/ui/views/notifications/build-notification#Updating