VOriginal post
Flutter Developer
Im currently trying to get this example to work
Dart
late final Session session; try { session = await account.getSession(sessionId: "current"); } on AppwriteException catch (e) { print(e.message); session = await account.createEmailPasswordSession( email: "t@t.t", password: "testtest"); } print("Session: $session");
final realtime = Realtime(client); final realtimeSub = realtime.subscribe( ["documents"], ); realtimeSub.stream.listen((event) { print("Realtime event"); });
await Future.delayed(const Duration(seconds: 3));
final customer = { "id": 123456, "name": "John Doe", };
final response = await database.createDocument( databaseId: "default", collectionId: "customers", documentId: ID.unique(), data: customer, );
print("Document: $response");
final customers = await database.listDocuments( databaseId: "default", collectionId: "customers", );
print("Customers: ${customers.documents}");If the collections has create permission for the user and document security enabled then i dont receive a realtime event
If the collection has the same permissions + read permissions for guests then im able to receive the realtime event
So im not sure what exactly im doing wrong. Am i creating the subscription wrong or am i missing something with the permissions?
Summary
Developers are experiencing issues when trying to use Realtime feature in their code. Realtime events are only emitted when the collection has read permissions for guests. Realtime events are not received if the create permission is only set for the user, even with document security enabled. Check subscription creation and permissions settings.