Back

Disconnect from Real Time Connection (React Native)

  • 0
  • Self Hosted
  • Web
  • Realtime
Collin
28 Jan, 2024, 06:14

I have implemented the use of real time connection in my school project that is built with React Native and Expo. I have followed the documentation from the site that shows on how to unsubscribe. From what I have gathered from other sources and videos explaining its use when doing so in React calling it in a cleanup function should and does prevent more connections from being made to the same event. The problem that I am having is not being able to disconnect the real time connection when the unmount occurs when the current screen is not in focus. Is there something else that I am missing that I need to do? The docs seem like it should disconnect from it, maybe it should and react/react native does something differently that I do not know.

TL;DR
Developers are having trouble disconnecting from a real-time connection in a React Native and Expo project. They followed the documentation and tried calling the unsubscribe function in a cleanup function, but it doesn't seem to work when the screen is not in focus. They're wondering if they're missing something or if React/React Native works differently. A solution or explanation for this issue is not provided.
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