Back

How to close re connect a realtime subscription in an instance.

  • 0
  • Flutter
  • Realtime
  • Cloud
opbaba_
15 Feb, 2024, 07:38

I'm facing an issue where if an user closes the realtime subscription, I am not able to set up a subscription again. It returns a null when i try to do so.

What would be the way to approach this?

Also, what would be the proper approach to re connect the realtime if an user loses an internet connection without restarting the app.

TL;DR
Issue: Null error occurs when trying to set up a new realtime subscription after the previous one is closed. Additionally, looking for a proper approach to reconnect realtime when an user loses internet connection without app restart. Solution: When closing the realtime subscription, ensure that any necessary cleanup or resetting of variables is done to avoid null errors when setting up a new subscription. To reconnect realtime after an internet connection loss, implement a retry mechanism that automatically attempts to reconnect periodically until a successful connection is established.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more