
Im currently trying to get this example to work
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?
Recommended threads
- Flutter OAuth2 Google does not return to...
When the flow starts, the browser opens, I select an account, and it keeps showing: """ Page not found The page you're looking for doesn't exist. `general_rout...
- list() is very slow; eventually shows no...
When I use the web browser to view the collections in my database, the documents they contain are normally displayed within a few seconds. For a few days now, h...
- Can't start docker containers beacuse no...
Hi, I'm testing my app where I upload also files to appwrite storage. As I suspect, I've filled up my disk. Now I can't start Appwrite. Could I ask for help wit...
