Back

How to check if RealtimeSubscription is still active

  • 0
  • Flutter
  • Realtime
  • Webhooks
Kevins35
10 Oct, 2023, 17:36

My Flutter app listens to document changes in the appwrite database. However after letting my software stay open for some Time (while not using it), or letting it run in the background for some time, it seems, that it doesn't react to these updates. First Question: Is this a Problem with my Flutter App or with Appwrite Second Question: How can I prevent such a behaviour or how can I notice the cutoff and reconnect?

TL;DR
The user is experiencing an issue with their Flutter app not reacting to document changes in the Appwrite database after the app has been left open for some time or running in the background. They are asking if this is a problem with their app or with Appwrite. The suggestion is made that this issue could be due to mobile devices having strict rules for running apps in the background. It is also mentioned that streams have an `onDone` callback that can be used to check if the RealtimeSubscription is still active. No solution is provided in the support thread.
Kevins35
10 Oct, 2023, 17:37

How to check if RealtimeSubscription is still active

Drake
10 Oct, 2023, 19:47

Is this a Problem with my Flutter App or with Appwrite

Flutter (more specifically mobile)

How can I prevent such a behaviour

You can't. Mobile devices may have strict rules for things running and may close/halt your app when it's in the background

how can I notice the cutoff and reconnect

streams have an onDone callback you can try to use

Kevins35
10 Oct, 2023, 21:00

Thanks for the quick answer. You helped me 🙂 Quick follow up question: Desktop or Web Versions of Flutter Apps don’t have this issue of the stream getting cancelled right?

Drake
10 Oct, 2023, 23:00

Not that I know of

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