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

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


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?





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


.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.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived