想知道FCM在以下情况下如何工作 [英] Want to know how FCM works in below scenarios

查看:78
本文介绍了想知道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.

即使用户从设备上卸载了[app],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 Cloud Messaging对您的应用程序用户一无所知,因此由您的应用程序代码来建立此连接.用户明确退出后,许多应用会从设备清除实例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.

另请参阅:

  • How to refresh FCM Token on user Logout?
  • Firebase Cloud Messaging - Handling logout
  • How to unsubscribe from FCM notifications after logout from app?
  • How to release Firebase Cloud Messaging token when Android user logs out?

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

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