Interface ChatConnectionListener

    • Constructor Detail

    • Method Detail

      • onIncomingMessage

         abstract void onIncomingMessage(ChatConnection chat, Array<byte> envelope, long serverDeliveryTimestamp, ChatConnectionListener.ServerMessageAck sendAck)

        Called when the server delivers an incoming message to the client.

        {@param serverDeliveryTimestamp} is in milliseconds.

        If {@param sendAck}'s send method is not called, the server will leave this message in the message queue and attempt to deliver it again in the future.

      • onQueueEmpty

         void onQueueEmpty(ChatConnection chat)

        Called when the server indicates that there are no further messages in the message queue.

        Note that further messages may still be delivered; this merely indicates that all messages that were in the queue when the websocket was first connected have been delivered.

        The default implementation of this method does nothing.

      • onReceivedAlerts

         void onReceivedAlerts(ChatConnection chat, Array<String> alerts)

        Called when the server has alerts for the current device.

        In practice this happens as part of the connecting process.

        The default implementation of this method does nothing.

      • onConnectionInterrupted

         void onConnectionInterrupted(ChatConnection chat, ChatServiceException disconnectReason)

        Called when the client gets disconnected from the server.

        This includes both deliberate disconnects as well as unexpected socket closures. In the case of the former, the {@param disconnectReason} will be null.

        The default implementation of this method does nothing.