Firebase - .onDisconnect does not trigger when application is in recent app section

Multi tool use


Firebase - .onDisconnect does not trigger when application is in recent app section
I am using '.info/connected'
to check whether the user is online in my application and .onDisconnect
to set if the user has disconnected from the app. However, for both iOS and Android, if the application is minimized, without being closed(it is in recent apps section), .onDisconnect
will not get triggered.
'.info/connected'
.onDisconnect
.onDisconnect
How can I handle this case so that the user status is not online if the app is minimized without being closed?
.info/connected
1 Answer
1
If .info/connected
is true
, it means that either:
.info/connected
true
I think that in my case
.info/connected
is not triggered when you minimize the app on your phone, because the phone allows it to actually still get updated even in the background. So maybe that is why firebase does not get disconnected, because it is still actually connected to the device, despite the fact the app is running in the background. Do you think this might be the case? How would you handle this situation, if you were to implement the user presence in this case and you would not want to allow the user to have an online status while the app is running in the background?– EDJ
6 mins ago
.info/connected
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Quick answer on how the system works below. If that doesn't help enough, please edit your question to include the minimal code that reproduces the problem. It'll help us understand how you're using
.info/connected
.– Frank van Puffelen
23 mins ago