QuickBlox/quickblox-javascript-sdk

QB.chat listeners not working?

BertoGz opened this issue · 2 comments

Im trying to follow the docs to test out the listeners so I can begin using them in my app.
sample:

QB.chat.disconnect();

QB.chat.onDisconnectedListener = onDisconnectedListener;

function onDisconnectedListener() {
  console.log("onDisconnected");
}

But so far nothing is being console logged. I've also tested out with onSubscribeListener, onReconnectListener but no luck.
I checked the code in module and I saw this:
A bunch of JsDoc for the functions but they don't seem to exist ?

Screen Shot 2022-10-31 at 11 36 24 AM

Anyone having similar troubles or is this still wip? Thanks.

Sdk logs:
Screen Shot 2022-10-31 at 12 02 59 PM

I just realize that there is not a connect listener. I presumed that either the reconnect, or onConfirmSubscribe listener would be called but actually those are not the intended listeners to use. My work around for a "chat connect listener" is to simply update a "ChatConnected" state to true in the resolution of QB.Chat.Connect().
Then if my disconnect listener is called, update my chatConnected state to false.