iFrame integration. Keep chat instance alive

Description

I use RocketChat in my react app as a chat client. It is integrated into my React app as an iframe. User will see Chat window only when User clicks Chat tab. So only when user is in the Chat tab, my listeners to Rocketchat ‘message’ works. Once user closes the chat tab new my listener wouldn’t get any update. It is kinda expected, since there is nomore active iframe to rocketchat in my app.

The way how I want to use Rocketchat:

  • In an ideal world, I would use Rocketchat as a library in my react app. So I could listen to the existing connection status and show connection status on the top right corner of my web app all the time no matter if the Chat window is open.
    – I would keep listening to chat messages even if the chat tab is not present. Since I would use Rocketchat as an instance of the chat library.

What are the possible ways to keep listening Rocketchat to observe new messages and connection status outside of the page that includes iframe?

Server Setup Information

  • Version of Rocket.Chat Server: 4.8.3
  • Operating System: ubuntu 22.04
  • Deployment Method: snap
  • Number of Running Instances: 1
  • DB Replicaset Oplog: 1
  • NodeJS Version: v14.18.3
  • MongoDB Version: 4.2.17 / wiredTiger (oplog Enabled)
  • Proxy: N/A
  • Firewalls involved: no

Any additional Information

@dudanogueira your help is highly appreciated :pray:.

Hi!

You can try using our realtime API to listen to events and consume remote method.

Or, you can try contributing/testing/using this new project that is probably what you are looking for and is being developed in Google Summer of Project:

I want to avoid using Realtime API. Since it would hold another wss connection. And world decrease my server capacity twice.
Let me check the new project.