nebukadnezarOriginal post
Rank 2: Process
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:
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:
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
Summary
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.