Closed aravi365 closed 3 years ago
ConnectyCube.chat.onMessageListener = () => console.warn('MESSAGE RECEIVED');
i am in doubt, where to add this code inorder to catch the live messages in the chat. I am using function components instead of class.
You can add it whether you want, but better - in some long-lived place, e.g. some service class, not in component itself
When other user calls ConnectyCube.chat.send(..)
, then you will get the message inside ConnectyCube.chat.onMessageListener
Tried adding the code provided in the documentation, but there is nothing happening in the event of a new message arrived.
Please guide the best practices to fetch the live incoming messages in functional component using listeners (receiver side)
I am getting
ConnectyCube.chat.isConnected
false every second time that makes the listener not alive. Also, the chat history is taking too much time to get it loaded