如何知道Firebase云消息传递令牌已被禁用? [英] How can I know that a Firebase Cloud Messaging token is out of use?

查看:203
本文介绍了如何知道Firebase云消息传递令牌已被禁用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个用户可以有多个设备连接到他的账户。
因此,他可以拥有多个云消息令牌。
每当用户打开应用程序,该设备的令牌就会被发送到应用程序服务器并保存在那里。



如果用户从一个应用程序卸载应用程序他的设备?我没有机会告诉服务器令牌不再使用。
我是否可以通知其他用户,因为这个其他用户已经从原始用户那里获得了不再使用的令牌? div>


如果用户从他的某个设备上卸载应用程序,会发生什么情况?

通常,当您的应用程序被卸载时,建议您(开发人员)自动确保将相应的注册令牌从您的App Server中删除。


是否可以通知其他用户,因为这个其他用户已经从原始用户那里获得了不再使用的令牌?


没有。每个注册令牌对于每个设备都是唯一的。因此,请放心,如果注册令牌因任何原因无效/过期,则其他用户将无法使用它。向无效/过期的注册令牌发送消息将导致未注册错误。


A single user can have multiple devices connected to his account. Because of that he can have multiple cloud messaging tokens. Everytime the user opens the app the token from that device is send to the app server and saved there.

What happens if a user uninstalls the app from one of his devices? I have no chance to tell the server that the token is not longer in use. Can it occure that I notify an other user instead since this other user has acquired the not longer used token from the original user?

解决方案

What happens if a user uninstalls the app from one of his devices?

Usually, when your app is uninstalled, it is advisable for you (the developer) to automatically make sure that the corresponding registration token is deleted from your own App Server.

Can it occure that I notify an other user instead since this other user has acquired the not longer used token from the original user?

No. Each registration token is unique per each device. So rest assured that if a registration token is invalidated/expires for whatever reason, no other user will be able to use it. Sending a message to an invalid/expired registration token will result to a NotRegistered error.

这篇关于如何知道Firebase云消息传递令牌已被禁用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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