
As the title says, I've been running the code from the example to learn how to use it (and eventually I want to use a stream builder). I can't seem to get it working though. Here's my code:
TypeScript
void main() {
WidgetsFlutterBinding.ensureInitialized();
final client =
Client()
..setEndpoint('https://cloud.appwrite.io/v1')
..setProject('<omitted>');
final realtime = Realtime(client);
final subscription = realtime.subscribe([
'databases.<omitted>.collections.<omitted>.documents',
]);
subscription.stream.listen((response) {
// Callback will be executed on changes for documents A and all files.
print(response.payload.entries.length);
});
}
The only thing it outputs is:
TypeScript
flutter: subscription: wss://cloud.appwrite.io/v1/realtime?project=<omitted>&channels%5B%5D=databases.<omitted>.collections.<omitted>.documents
15
flutter: Received heartbeat response from realtime server
TL;DR
Developers are having trouble getting realtime to work on a Flutter project, despite following the example code. The code provided seems to set everything up correctly, but the expected output is not appearing.
Solution: A possible reason for this issue could be related to the network setup or the specific configuration of the Appwrite service. Double-check the network connectivity and ensure that the Appwrite service is configured correctly. If the issue persists, consider reaching out to Appwrite support for further assistance.Recommended threads
- I am facing this error: type 'Null' is ...
When attempting to fetch areas from the area collection, the application throws an error: "type 'Null' is not a subtype of type 'int.'" This issue originates in...
- Adding Domain to Sites [Self Hosted]
I am struggling to get this working. I stood-up a new server and deployed appwrite 1.7.4. I added update .env file _APP_DOMAIN=appwrite.mydomain.com _APP_DOMAI...
- Received duplicate events
I used the React Native SDK to subscribe to `buckets.<ID>.files` on the client side. When the backend creates a file, two events are logged in my client's conso...
