Firebase 令牌错误 TOO_MANY_REGISTRATIONS

Firebase token error TOO_MANY_REGISTRATIONS

在阅读了 100 多个线程并进行了谷歌搜索后,我仍然对以下错误消息感到困惑。

目前,我正在使用 Firebase 云消息传递,在很短的时间内,我正试图从 Firebase 获取我的令牌,以便能够将消息发送到我的服务器。 我已经尝试过这两种方法:

String token = FirebaseInstanceId.getInstance().getToken(mySenderId, "FCM");

String token = FirebaseInstanceId.getInstance().getToken();

所以在日志中,我读到:

E/FirebaseInstanceId: Token retrieval failed: TOO_MANY_REGISTRATIONS
                                 java.io.IOException: TOO_MANY_REGISTRATIONS

根据其他帖子和答案,这是 "Too many installed applications on the device that are registered with C2DM/GCM/FCM" 的原因。我还读过 "Max 100 GCM/FCM registered applications installed on the device".

的限制

但这不完全正确,对吗?我的意思是,这可能是真的,但这并不是这个问题的全部答案。我一直在使用不同的设备进行工作和测试,而我当前的设备没有在 FCM 上注册 100 个应用程序。事实上,我的设备甚至根本没有安装 100 个应用程序,差得远!

有什么方法可以管理以前注册的设备和令牌吗?我尝试 运行 以下代码但没有任何运气:

FirebaseInstanceId.getInstance().deleteInstanceId();

我曾尝试确定来自不同来源(包括文档)的信息,但没有理解这实际上是如何工作的。不久前,我在旧的 C2DM 和最近的 GCM 上遇到了同样的问题。几天前我已经与 Firebase 合并以使用它的功能而不是对此进行改进的想法,但它仍然回荡在我身上。

在与 Google 团队直接交谈后,我从他们那里得到了以下答复:

The team confirmed and clarified their data indicated that the device is not really a normal device and this is either:

  1. a virtual device (emulator) being reused too many times

  2. a real device used in automated way to test too many apps

  3. a real device which has been customized with a CLONE image of the system partition, CLONED from a different device

If this is a real device, the best way to solve it is to factory reset to the real system image of the device. Since this device is prob currently stuck in 2 or 3, would you mind factory resetting the device and let us know if the issue still reproduce?

我对我的设备进行了恢复出厂设置,问题消失了。我仍然不明白这是怎么出现的以及为什么会这样。

我怀疑这些测试来自 Google 机器人,我刚刚发布了我的应用程序,在 firebase 身份验证中出现了三个登录名,其中的电子邮件似乎是假的,例如 johniefernandez.39356@gmail.com . 我怀疑所有的电子邮件都是以句号和数字结尾的机器人,例如“.39356” 我来自巴西,我通过 Analytics 看到用户来自美国,只有 3 个,所以我知道他们是测试,因为我没有为美国发布我的应用程序。