Reputation: 57
I want to know how FCM Notifications works in below scenarios:
Same user logging into multiple devices. Will all the devices gets the notification?
What if user uninstalls the app? Does FCM sends the notification even if user uninstalls the device, and later checks for sending failed event?
If login changes on the device - Suppose if I login to a device as user A, and then logged out of the device and logged in as user B. I must not get the notifications for user A. How this situation is handled in FCM?
Upvotes: 0
Views: 644
Reputation: 598765
Same user logging into multiple devices - Will all the devices gets the notification?
Firebase Cloud Messaging sends messages to devices, it doesn't know anything about users. If you're sending messages to FCM Instance IDs, the message will only be delivered to the device with that ID. If you're sending messages to topics, the message will only be delivered to devices that subscribed to that topic.
Does FCM sends the notification even if user uninstalls the [app from the device]?
When the app is uninstalled, the Instance ID for that app installation is deleted to. So no message will be delivered to the app on that device anymore.
If the user later reinstalls the app on the device, it generates a new Instance ID. So it won't receive any messages from when the app was uninstalled.
If login changes on the device - Suppose if I login to a device as user A, and then logged out of the device and logged in as user B. I must not get the notifications for user A. How this situation is handled in fCm?
Since Firebase Cloud Messaging doesn't know anything about the users of your app, it is up to your application code to make this connection. Many apps clear the Instance ID from the device when a user explicitly signs out.
Also see:
Upvotes: 2