Skip to content

ktx/4.30.0

Choose a tag to compare

@sendbird-sdk-deployment sendbird-sdk-deployment released this 22 Oct 09:08
· 38 commits to main since this release
04efeb7

Features

  • Added onConnectionDelayed callback to ConnectionHandler.
    • A new callback method that is invoked when the server is overloaded. This callback provides information about the delay time before automatic reconnection. After the delayed time period, the SDK automatically initiates reconnection and triggers the callback sequence: onReconnectStartedonReconnectSucceeded
      interface ConnectionHandler {
          fun onConnected(userId: String) {}
          fun onDisconnected(userId: String) {}
          fun onReconnectStarted() {}
          fun onReconnectSucceeded() {}
          fun onReconnectFailed() {}
      
          /**
          * A callback for when the connection is delayed.
          *
          * @param retryAfter The time in seconds to wait before the next reconnection attempt.
          */
          fun onConnectionDelayed(retryAfter: Long) {}
      }
      
      runCatching {
          SendbirdChat.awaitConnect(USER_ID, AUTH_TOKEN)
      }.onSuccess { user ->
          // Connection successful
      }.onFailure { e ->
          val sendbirdException = e as SendbirdException
          if (sendbirdException.code == SendbirdError.ERR_CONNECTION_DELAYED) {
              val data = sendbirdException.data
              // The delay time in seconds before automatic reconnection
              val retryAfter: Long = data["retry_after"] as? Long ?: 0
              // Server-provided reason code for the delay
              val message = data["message"] as? String ?: ""
              // Detailed error message explaining the delay
              val reasonCode: Int = data["reason_code"] as? Int ?: 0
      
              // The SDK will automatically retry after the specified delay time
              // and the result will be notified through ConnectionHandler.onReconnectSucceeded().
          }
      }
  • Added SendbirdChat.Options.setTypingIndicatorInvalidateTime(invalidateTimeMillis: Long)
    • Sets typing indicator invalidation time. Defaults to 10000 (10 seconds)

Improvements

  • Added a condition in AIAgentGroupChannelListQuery.belongsTo() to exclude non–AI Agent and non–Desk channels from the query results.