Back

[SOLVED] how to connect with realtime in flutter

  • 0
  • Flutter
  • Realtime
Drake
22 Apr, 2023, 22:50

How are you initializing the client that you're passing into Realtime?

TL;DR
The user had an issue with connecting in real-time in Flutter. After some suggestions from the thread, the user removed the setEndpointRealTime() function and it started working. However, the user was still facing issues with printing responses. The thread also included discussions about initializing the client and using the correct channel. Solution: Removing the setEndpointRealtime() and passing the correct channel resolved the issue.
new user
22 Apr, 2023, 22:51
TypeScript
        ['databases.6439e7ae4abb3e14f2b1']);```
Drake
22 Apr, 2023, 22:52

I meant the Client, not Realtime..also this is an invalid channel. What you had before was correct

new user
22 Apr, 2023, 22:53

my mistake i am using like final realtime = Realtime(client).subscribe( ['databases.6439e7ae4abb3e14f2b1.collections.64444e34a0ce20bc4ac8.documents'] );

Drake
22 Apr, 2023, 22:54

That looks like the wrong collection id

Drake
22 Apr, 2023, 22:55

Wait no....I meant the url of the console where you're on the permission settings

new user
22 Apr, 2023, 22:55

correct it but not working final realtime = Realtime(client).subscribe( ['databases.6439e7ae4abb3e14f2b1.collections.6439e7dd6c9e8a193946.documents'] );

new user
22 Apr, 2023, 22:55

here is how i intialize clinet Client client = Client().setEndpoint('http://192.168.29.63/v1') .setProject('64386b13977ba3c49d06') .setSelfSigned(status: true);

Drake
22 Apr, 2023, 22:57

And you're not doing anything else to client? Just passing it into Realtime?

Drake
22 Apr, 2023, 22:57

Please share the url of this page

new user
22 Apr, 2023, 22:57

yes, just passing it

new user
22 Apr, 2023, 22:58

i also tried to print response but its showing null

Drake
22 Apr, 2023, 23:01

Is all your code in one file?

Drake
22 Apr, 2023, 23:02

Please share the url of this page

new user
22 Apr, 2023, 23:03

no i have define in different files

Drake
22 Apr, 2023, 23:05

Ok that's fine

Drake
22 Apr, 2023, 23:05

Please share the url of this page.

new user
22 Apr, 2023, 23:05

and also intialize this two time one for run time and second for constant when ever i need to call client client.setEndpoint('http://192.168.29.63 /v1') .setEndPointRealtime('http://192.168.29.63') .setProject('64386b13977ba3c49d06') .setSelfSigned(status: true);

Drake
22 Apr, 2023, 23:06

Ah there it is...can you try to remove that setEndPointRealtime() call?

new user
22 Apr, 2023, 23:07

yes i have tried but not worked

Drake
22 Apr, 2023, 23:07

Okay just make sure not to call that function

Drake
22 Apr, 2023, 23:08

Now please share the url of this page

new user
22 Apr, 2023, 23:09

just removed the setEnpointRealTime() now its working.

Drake
22 Apr, 2023, 23:11

[SOLVED] how to connect with realtime in flutter

new user
22 Apr, 2023, 23:12

wow, glory to god, as i was trying to implement from last week now its working, Thank you Steven for your kind help.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more