简体   繁体   English

Firebase 令牌错误 TOO_MANY_REGISTRATIONS

[英]Firebase token error TOO_MANY_REGISTRATIONS

After reading 100's of threads and googling I am still confused about this following error message.在阅读了 100 多个线程并进行了谷歌搜索后,我仍然对以下错误消息感到困惑。

Currently, I am using Firebase Cloud Messaging and in very short terms I am trying to get my token from Firebase to be able to send messages to my server.目前,我正在使用 Firebase 云消息传递,在很短的时间内,我试图从 Firebase 获取我的令牌,以便能够将消息发送到我的服务器。 I've tried with both these methods:我试过这两种方法:

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

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

So in the logs, I read this:所以在日志中,我读到这个:

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

According to other posts and answers, it's a cause of "Too many installed applications on the device that are registered with C2DM/GCM/FCM".根据其他帖子和答案,这是“设备上安装的应用程序太多,这些应用程序已注册到 C2DM/GCM/FCM”的原因。 I've also read there was a limitation of "Max 100 GCM/FCM registered applications installed on the device".我还读到过“设备上安装的最多 100 个 GCM/FCM 注册应用程序”的限制。

But this is not simply true, is it?但这不仅仅是真的,不是吗? I mean, it may be true but it isn't the whole answer to this issue.我的意思是,这可能是真的,但这并不是这个问题的全部答案。 I am constantly working and testing with different devices and my current device DOES NOT have 100 applications registered with FCM.我一直在使用不同的设备进行工作和测试,而我当前的设备没有在 FCM 上注册 100 个应用程序。 In fact, my device does not even have 100 applications installed at all, far from it!事实上,我的设备甚至根本没有安装 100 个应用程序,远非如此!

Is there any way to manage previous registered devices and tokens?有什么方法可以管理以前注册的设备和令牌吗? I've tried to run the following code without any luck:我试过运行以下代码但没有任何运气:

FirebaseInstanceId.getInstance().deleteInstanceId();

I've tried to nail down information from different sources (including the documentation) without luck of understanding how this actually works.我试图确定来自不同来源(包括文档)的信息,但没有理解这实际上是如何工作的。 I've had the same issue with old the C2DM a while ago and also with GCM lately.不久前,我在旧的 C2DM 和最近的 GCM 上遇到了同样的问题。 I've merged with Firebase a few days ago to use its features instead which the thoughts of improvements on this, but it still echoes back at me.几天前我已经与 Firebase 合并使用它的功能而不是改进的想法,但它仍然回荡在我身上。

After spoken directly with the Google team I got the following answer from them:在与 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已使用系统分区的 CLONE 映像自定义的真实设备,从不同设备克隆

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?由于此设备目前卡在 2 或 3 中,您介意出厂重置设备并让我们知道问题是否仍然重现吗?

I have performed a factory reset on my device and the issue is gone.我在我的设备上执行了恢复出厂设置,问题消失了。 I still don't see exactly how this can appear and why.我仍然不明白这究竟是如何出现的以及为什么。

I suspect that these tests are from Google robots, I just published my application and in firebase authentication three logins appear with emails that appear to be fake, such as johnniefernandez.39356@gmail.com.我怀疑这些测试来自 Google 机器人,我刚刚发布了我的应用程序,并且在 firebase 身份验证中出现了三个登录名,其中的电子邮件似乎是假的,例如 johnniefernandez.39356@gmail.com。 All emails that I suspect are robots end with a period and a number like ".39356" I'm from Brazil and I see through Analytics that the users are from the United States, only 3, so I understand that they are tests, because I haven't published my app for the United States.我怀疑是机器人的所有电子邮件都以句点和数字结尾,例如“.39356” 我来自巴西,我通过 Analytics 看到用户来自美国,只有 3 个,所以我知道它们是测试,因为我还没有为美国发布我的应用程序。

I got these errors reported to firebase crashlytics for my app that is in internal testing, the weird part is it happened to 5 users which is just weird because there's only me who have access to the app.我在内部测试中收到这些错误报告给 firebase crashlytics,奇怪的是它发生在 5 个用户身上,这很奇怪,因为只有我可以访问该应用程序。 So I think it is probably Google's automated testing bots.所以我认为这可能是谷歌的自动化测试机器人。 Here's the logs这是日志

Non-fatal Exception: io.invertase.firebase.crashlytics.JavaScriptError: [messaging/unknown] java.io.IOException: java.util.concurrent.ExecutionException: java.io.IOException: TOO_MANY_REGISTRATIONS
       at .getToken(address at index.android.bundle:1:905545)
       at .?anon_0_(address at index.android.bundle:1:1790016)
       at .next((native):0:0)
       at .asyncGeneratorStep(address at index.android.bundle:1:65498)
       at ._next(address at index.android.bundle:1:65769)
       at .tryCallOne(InternalBytecode.js:53:16)
       at .anonymous(InternalBytecode.js:139:27)
       at .apply((native):0:0)
       at .anonymous(address at index.android.bundle:1:191460)
       at ._callTimer(address at index.android.bundle:1:190409)
       at ._callReactNativeMicrotasksPass(address at index.android.bundle:1:190573)

Even funnier is, I was not testing the app when these crashes were reported.更有趣的是,报告这些崩溃时我并没有在测试应用程序。

Also when I open my app on real devices (low end and high end devices), I don't encounter any of these crashes being reported.此外,当我在真实设备(低端和高端设备)上打开我的应用程序时,我没有遇到任何这些崩溃报告。

The device info is:设备信息为:

Device
Brand:Google
Model:sdk_goog3_x86_64
Orientation: Portrait
RAM free: 2.01 GB
Disk free: 29.95 GB

Operating System
Version:Android 13
Orientation: Portrait
Rooted:No

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM