QuickBlox / quickblox-javascript-sdk

JavaScript SDK of QuickBlox cloud backend platform
Other
105 stars 217 forks source link

QB.chat listeners not working? #436

Closed BertoGz closed 2 years ago

BertoGz commented 2 years ago

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.

BertoGz commented 2 years ago

Sdk logs:

Screen Shot 2022-10-31 at 12 02 59 PM
BertoGz commented 2 years ago

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.