Recall & Review
beginner
What is a notification message in Firebase Cloud Messaging?
A notification message is a message that contains a predefined set of user-visible keys. It is handled by the system when the app is in the background and automatically displays a notification to the user.
Click to reveal answer
beginner
What is a data message in Firebase Cloud Messaging?
A data message contains only custom key-value pairs defined by the developer. It is handled by the app code directly, allowing custom processing whether the app is in the foreground or background.
Click to reveal answer
beginner
How does the app behave when receiving a notification message while in the background?
The system automatically displays the notification to the user without involving the app code, making it simple to show alerts when the app is not active.
Click to reveal answer
intermediate
Can data messages be received and processed when the app is in the background?
Yes, but the app must have code to handle data messages in the background. This allows more control but requires extra setup.
Click to reveal answer
intermediate
Which message type should you use if you want to customize the notification appearance fully?
Use data messages because they let your app handle the message and create a custom notification with any look or behavior you want.Click to reveal answer
What happens when a notification message arrives while the app is in the background?
✗ Incorrect
Notification messages are handled by the system when the app is in the background, so the notification shows automatically.
Which message type contains only custom key-value pairs without predefined keys?
✗ Incorrect
Data messages contain only custom data defined by the developer.
If you want to handle messages only when the app is in the foreground, which message type can you use?
✗ Incorrect
Both notification and data messages can be handled when the app is in the foreground.
Which message type requires you to write code to display notifications?
✗ Incorrect
Data messages require app code to process and display notifications.
What is a key advantage of using data messages over notification messages?
✗ Incorrect
Data messages let you customize how notifications look and behave by handling them in your app.
Explain the difference between notification messages and data messages in Firebase Cloud Messaging.
Think about who handles the message and when.
You got /4 concepts.
Describe a scenario where you would prefer to use data messages instead of notification messages.
Consider control and customization needs.
You got /4 concepts.