DRY Believer
DRY Believer

Reputation: 1018

Handling time out in firebase

I am trying to implement registration using firebase, but somehow when connection breaks,onCancelled() is not getting called.I tried working with onDisconnect() but no success.Finally i landed up calling a php wrapper for firebase and got rid of this problem.The wrapper i used is https://github.com/ktamas77/firebase-php. Is this wrong way of implementing because there are 2 server calls(->php->firebase) involved which will eventually make my application slow or there is an alternate to time out.

Upvotes: 0

Views: 2474

Answers (1)

Jay
Jay

Reputation: 35657

You should really explore why your onDisconnect() is not working as it's reliable and works well.

If you really want to monitor your connection status, look into the .info/connected special location in Firebase.

How to build a user presence system

Managing Presence

about 1/2 way down in the Detecting Connection State section.

We have a singleton that monitors connection status and when the connection is lost all of our classes are notified so they can take appropriate action.

Upvotes: 2

Related Questions