Re-open websocket connection

Hi, I’m building a native Android chat connecting with the websocket. The problem is that sometimes when the user closes the app the websocket connection will be closed. How can I connect the user again and make them go to the same session? Is it possible?

The reason why I need them to come back to the same session is that they might be talking to our support team, if the come back as a new session, they will not come back to the agent they were talking to.

Hi Lucas,

Thank you for reaching out to Kore.ai Community.
For the requirement which you have shared, you can continue to the previous conversation by adding “isReconnect = true” flag while connecting to the socket.

Thank you,
Srujan Madderla
Kore.ai Community Team

Excellent, @srujan, this worked!

But now I need to know how can I find out whether a session is still open or it has been closed (to know if I need the flag or not).

Is there any API that returns me if a session is open or not? How do you advise me on when to use “isReconnect = true” or not?

Hi @lucas.garcia,

We would like to inform you that there is no API to verify the session in SDK level.
But we can see the session is being continued or not in Bot Builder analytics tab.

Please refer to the below documentation for more information on Analytics.

Thank you,
Srujan Madderla
Kore.ai Community Team