且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何限制Firebase Android上的并发连接

更新时间:2023-12-01 17:33:58


我只是为了学习开发,我假设我将快速到达100个设备/用户。


您会对此感到惊讶。大多数开发者大大高估了他们将得到的并发用户的数量。但是,如果你确实得到了他们,这将是一个很好的问题。 :)



调用 addListenerForSingleEventValue()将在第一个值后删除侦听器,但不会关闭连接。要以编程方式关闭连接,请再次调用 Firebase.goOffline(),然后再调用 Firebase.goOnline()。 >

it might be not the place, but in Firebase's site it seems that it is acceptable to ask here. In the free plan of them, where you are limited to 100 devices connected at the same time, is it when you use the AddValueEventListener () function, which make you still updated realtime.

what I want to do is just to request some data from the DB, and have users scrolling and getting more information and data when they want. I do it just to learn development, but in what I assume I will reach the 100 Devices/Users fast.

If I use the AddListenerForSingleEventValue () which actually Detach the listener after the first call, will it be possible to have more then 100 devices using my app with the data provided by the application? do they mean in the site that I cannot have more then 100 listeneres at the same time? (and if I detach it it's fine)

I do it just to learn development, but in what I assume I will reach the 100 Devices/Users fast.

You'd be surprised about that. Most developers vastly over-estimate the number of concurrent users they will get. But if you do get them, that'd be a good problem to have. :-)

Calling addListenerForSingleEventValue() will remove the listener after the first value, but it will not close the connection. To programmatically close the connection, call Firebase.goOffline() and then Firebase.goOnline() again.