In Firebase Cloud Messaging, when you send a message to a topic, how does the service deliver the message?
Think about how topics help reach multiple devices at once.
Topic-based messaging delivers messages to all devices subscribed to that topic, whether they are currently connected or not. Firebase handles storing and forwarding messages as needed.
You want to send notifications to users grouped by their interests. Which topic naming strategy is best to organize these groups?
Think about how topics help target groups efficiently.
Creating one topic per interest allows sending messages only to users interested in that topic, making messaging efficient and organized.
Which method best prevents unauthorized users from subscribing to sensitive topics?
Consider where subscription control should happen for security.
Subscribing users to topics on the server after verifying permissions ensures only authorized users get subscribed, preventing unauthorized access.
Which code snippet correctly subscribes a device to a topic using Firebase Cloud Messaging in JavaScript?
import { getMessaging, getToken, onMessage } from 'firebase/messaging'; const messaging = getMessaging(); // Which option correctly subscribes to 'news' topic?
Firebase client SDK does not directly subscribe to topics; it requires server interaction.
Firebase client SDK does not provide a direct method to subscribe to topics. Instead, the client sends the device token to the server, which subscribes the token to the topic using Firebase Admin SDK.
Your app has millions of users subscribed to multiple topics. What is the best practice to avoid hitting Firebase Cloud Messaging limits when sending topic messages?
Think about how to manage large scale messaging without errors.
Firebase enforces rate limits on messaging. Batching messages and adding delays helps avoid hitting these limits and ensures reliable delivery.