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
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...
- Sign In With Apple OAuth Help
Hi All! I've got a flutter & appwrite app which Im trying to use sign in with apple for. I already have sign in with google working and the function is the sam...
- [SOLVED] OAuth With Google & Flutter
Hi all, I'm trying to sign in with google and it all goes swimmingly until the call back. I get a new user created on the appwrite dashboard however the flutte...