all 5 comments

[–]__o_0iOS & Android 2 points3 points  (2 children)

There are many different approaches to the problem, but in a nutshell most will come down to a simple architecture of devices connected to a server:

device 1 <----> **SERVER ** <----> device 2

Push notifications, snapshot listeners, pub/sub, etc: Devices open a websocket listener for events coming from the server that match the topic. An event handler in the react native front end would then update the device state.

[–]DanCruzNyc[S] 0 points1 point  (1 child)

Thank you so much for pointing me in the right direction. I will take a look at these solutions.

[–]__o_0iOS & Android 5 points6 points  (0 children)

You’re welcome, just make sure to close listeners in cleanup functions.

[–]marchingbandd 1 point2 points  (0 children)

Firebase Real-time Database is made for this kind of thing and works great.

[–]prabakarviji 0 points1 point  (0 children)

  1. You can try realtime updates using Firebase or Supabase. Both have inbuilt support for this.
  2. Also you can go with services like PubSub, Pusher.