firebase realtimeDB同时连接? [英] firebase realtimeDB simultaneous connected?

查看:127
本文介绍了firebase realtimeDB同时连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序在后台运行。如果应用程序在后台运行,仍然与realtimeDB同时连接?或者,如果这个应用程序不使用realtimeDB一段时间,不计算同时连接?



如果它反正计数,我只能得到10万用户?

解决方案

只要您的侦听器处于活动状态,您的应用就会连接到realtimeDB。如果您想停止监听,您需要根据自己的需要和活动周期来移除监听器。

对于 Android onDestroy()方法中使用此代码。

  databaseReference.removeEventListener(valueEventListener); 

希望有帮助。


My app run in background. If app run in background, is still simultaneous connected with realtimeDB? Or if this app doesn't use realtimeDB for a while, does not count simultaneous connected?

If it's count anyway, can I only get 100,000 user?

解决方案

Your app is connected to the realtimeDB as long as your listener is active. If you want to stop listening you need to remove the listener according to your needs and to the activity cycle.

For Android you can use this code in your onDestroy() method.

databaseReference.removeEventListener(valueEventListener);

Hope it helps.

这篇关于firebase realtimeDB同时连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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