想知道 FCM 在以下场景中的工作原理 [英] Want to know how FCM works in below scenarios

查看:18
本文介绍了想知道 FCM 在以下场景中的工作原理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道 FCM 通知在以下情况下的工作原理:

I want to know how FCM Notifications works in below scenarios:

  1. 同一用户登录多个设备.所有设备都会收到通知吗?

  1. Same user logging into multiple devices. Will all the devices gets the notification?

如果用户卸载应用怎么办?即使用户卸载设备,FCM 也会发送通知,然后检查发送失败事件吗?

What if user uninstalls the app? Does FCM sends the notification even if user uninstalls the device, and later checks for sending failed event?

如果设备上的登录发生变化 - 假设我以用户 A 的身份登录设备,然后退出设备并以用户 B 的身份登录.我不能收到用户 A 的通知.这是怎么回事情况在 FCM 中处理?

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?

推荐答案

同一用户登录多个设备 - 所有设备都会收到通知吗?

Same user logging into multiple devices - Will all the devices gets the notification?

Firebase Cloud Messaging 向设备发送消息,它对用户一无所知.如果您要向 FCM 实例 ID 发送消息,则消息只会传送到具有该 ID 的设备.如果您要向主题发送消息,则消息只会发送到订阅该主题的设备.

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.

即使用户卸载了[设备上的应用],FCM 是否也会发送通知?

Does FCM sends the notification even if user uninstalls the [app from the device]?

卸载应用后,该应用安装的实例 ID 将被删除.因此,不会再向该设备上的应用发送任何消息.

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.

如果用户稍后在设备上重新安装应用程序,它会生成一个新的实例 ID.所以它不会收到应用程序卸载时的任何消息.

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.

如果设备上的登录发生变化 - 假设我以用户 A 的身份登录到设备,然后退出设备并以用户 B 的身份登录.我不能收到用户 A 的通知.如何处理这种情况以 fCm 为单位?

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?

由于 Firebase 云消息传递对您应用的用户一无所知,因此建立此连接取决于您的应用代码.当用户明确退出时,许多应用会从设备中清除实例 ID.

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.

另见:

这篇关于想知道 FCM 在以下场景中的工作原理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆