Back

Does Appwrite React Native SDK Support Realtime?

  • 0
  • React Native
aaronksaunders
13 Nov, 2024, 20:41

I have reviewed the doc and can I assume that since it is not an option to select over the code samples, that it is not supported?

TL;DR
The developer encountered a WebSocket error with the Realtime feature while using the Appwrite React Native SDK. Another developer suggested checking the client-side code for subscribing to Realtime events and provided a link to the relevant code in the React Native SDK repository. The initial developer expressed confusion about Realtime support in the SDK, as they couldn't find it mentioned in the documentation.
Kenny
13 Nov, 2024, 20:44

No, I wouldn't make that assumption about anything lol

You can subscribe to realtime events on any client side sdk.

Here is the code in the react-native sdk that does it, if you were curious. https://github.com/appwrite/sdk-for-react-native/blob/main/src/client.ts#L367

Kenny
13 Nov, 2024, 20:45

They offer tons of sdks, it's hard to provide examples for every single one, and the reactive native sdk is very very similar to the web sdk.

aaronksaunders
13 Nov, 2024, 20:46
TypeScript
 LOG  [app Index]
 ERROR  WebSocket error: {"isTrusted": false, "message": "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)"}
 LOG  WebSocket connection closed
 ERROR  Realtime got disconnected. Reconnect will be attempted in 1 seconds. The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)
 ERROR  Realtime got disconnected. Reconnect will be attempted in 1 seconds. The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)
 ERROR  Realtime got disconnected. Reconnect will be attempted in 1 seconds. The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)
 ERROR  Realtime got disconnected. Reconnect will be attempted in 1 seconds. The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)
 ERROR  Realtime got disconnected. Reconnect will be attempted in 1 seconds. The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)
 ERROR  Realtime got disconnected. Reconnect will be attempted in 5 seconds. The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)
 ERROR  Realtime got disconnected. Reconnect will be attempted in 5 seconds. The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)
 ERROR  Realtime got disconnected. Reconnect will be attempted in 5 seconds. The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)
 ERROR  Realtime got disconnected. Reconnect will be attempted in 5 seconds. The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)

i followed the web sdk since there was no example and this is the error I am getting

aaronksaunders
13 Nov, 2024, 20:46

will take a look at the link u provided to see if I am missing something

Kenny
13 Nov, 2024, 20:54

Are you able to get anything else working? I believe that error is a unknown host error, so I don't think that's an appwrite issue directly? Are you self hosted?

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