Closed gekylafas closed 2 weeks ago
Hi @gekylafas,
Session events, as well as any other method you can find in the Session and User methods of our wiki are sent only when the socket is connected, so when the user has opened the chatbox indeed. As soon as he closes it, the socket is also closed. For info, a session:loaded callback is planned for the next release as discussed in #169.
There is no way to send events right away unless the user have the chatbox opened because we cannot leave the socket opened during the whole app lifecycle and REST calls are not available for them for the moment. However, unless you reset the session or switch website, these events are cached and will be sent in the next chatbox opening, that's what the Session and User methods header meant.
OK, thanks for the clarification! I'd suggest copying this detailed explanation to the Wiki too, so that it's more easily accessble than searching though issues. If you don't plan to do it, however, you may close this issue.
I've updated the wiki section, I hope it is more intelligible :)
Thanks, it's much better now. I am closing the issue.
I am trying to send session events from my app, but I can't understand when the events are actually sent and visible to the Crisp console.
The function I am using is
Crisp.pushSessionEvent(SessionEvent event)
. There is no documentation about this function other than the simple (and not terribly englightening):The documentation for the whole session section consists of the following cryptic message:
What does this sentence mean?
Also, when is the "socket already connected"? Does this mean at the moment the chat window is opened? If yes, does this also mean that session events are not sent until the user opens the chat?! If yes, how can I trigger the sending of events right away?