0
0
Android Kotlinmobile~5 mins

Cloud Messaging (push notifications) in Android Kotlin - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is Firebase Cloud Messaging (FCM)?
Firebase Cloud Messaging (FCM) is a free service by Google that lets you send notifications and messages to Android, iOS, and web apps. It helps apps stay connected with users by delivering push notifications.
Click to reveal answer
beginner
Which Android component handles incoming push notifications?
The FirebaseMessagingService class handles incoming push notifications. You create a subclass and override the onMessageReceived() method to define how your app reacts when a message arrives.
Click to reveal answer
intermediate
What is the purpose of a notification channel in Android push notifications?
Notification channels group notifications by type and let users control settings like sound and vibration for each channel. They are required for Android 8.0 (API level 26) and above.
Click to reveal answer
intermediate
How do you get the device token for FCM in Kotlin?
You get the device token by calling FirebaseMessaging.getInstance().token.addOnCompleteListener { ... } which asynchronously returns the unique token identifying the device for push messages.
Click to reveal answer
beginner
Why is it important to handle notification clicks in your app?
Handling notification clicks lets you control what happens when a user taps a notification, such as opening a specific screen. This improves user experience by linking notifications to relevant app content.
Click to reveal answer
Which class should you extend to handle incoming FCM messages in Android?
AFirebaseMessagingService
BFirebaseInstanceIdService
CNotificationManager
DFirebaseAuth
What Android version introduced notification channels?
AAndroid 7.0 Nougat
BAndroid 9.0 Pie
CAndroid 8.0 Oreo
DAndroid 6.0 Marshmallow
How do you obtain the FCM device token in Kotlin?
AFirebaseInstanceId.getToken()
BFirebaseMessaging.getInstance().token.addOnCompleteListener { ... }
CNotificationManager.getToken()
DFirebaseAuth.getInstance().currentUser
What is the main purpose of a notification channel?
ATo store notification data
BTo send messages to multiple devices
CTo authenticate users
DTo group notifications and let users control their settings
Which Firebase service is used to send push notifications?
AFirebase Cloud Messaging
BFirebase Realtime Database
CFirebase Authentication
DFirebase Storage
Explain how to set up Firebase Cloud Messaging in an Android app using Kotlin.
Think about the steps from adding Firebase to handling messages and notifications.
You got /6 concepts.
    Describe why notification channels are important and how they affect user experience.
    Consider how users interact with notifications and their settings.
    You got /5 concepts.