Back

Realtime for specific collection

  • 0
  • Databases
  • Flutter
  • Realtime
  • Cloud
Tobias
24 Oct, 2024, 15:47
TypeScript
void _subscribeToSubmittedMediaAppend() {
    final realtime = Realtime(client);
    realtimeMediaValidationSubscription = realtime.subscribe(
        ['databases.$appDatabase.collections.$roomMediaCollection.documents']);
    // Listen to changes
    realtimeMediaValidationSubscription?.stream.listen((event) {

Why doesn't this work? it's not getting called

TL;DR
Developers are trying to implement realtime updates for a specific collection in their Dart code, but the function is not being called. The issue might be related to how the `subscribe` method is being used. To fix this, developers should ensure that the subscription path is correct by verifying the database, collection, and document names. Additionally, they should double-check that the Realtime client is properly initialized and connected.
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