Live UIKit Android v1
Live UIKit Android
Live UIKit
Android
Version 1

Authentication

Copy link

You can start building a live streaming experience with ready-made user interfaces by installing Sendbird UIKit. The UIKit is an add-on feature to Sendbird Live SDK and installing the UIKit will also install Sendbird Live SDK. Users authenticated through the UIKit can access Sendbird Live SDK without an additional authentication.

Before using any UI components from the Sendbird UIKit for Android, your application must authenticate a user and be connected to the Sendbird server. Then, the instance communicates and interacts with the server using an authenticated user account and the user can use the UIKit's features.


Connect to the Sendbird Server

Copy link

The SendbirdLiveUIKit.connect() method connects a user to the Sendbird server with the information you provided in SendbirdUIKitAdapter. If the user ID used during the connection attempt doesn't exist on the Sendbird server, a new user account is created with the specified user ID. The SendbirdLiveUIKit.connect() method also automatically updates the user profile on the Sendbird server.

Refer to the code below to see how to connect a user to the Sendbird server.

SendbirdLiveUIKit.connect { user, e ->
    if (e != null) {

        return@connect
    }
    // The user is online and connected to the server.
}

Disconnect from the Sendbird Server

Copy link

When the user no longer needs to use features from Sendbird Live SDK, it is recommended to disconnect the user from the server.

Call the SendbirdUIKit.disconnect() method to disconnect the user from the server.

SendbirdLiveUIKit.disconnect { e ->
    if (e != null) {

        return@connect
    }
    // The current user is disconnected from Sendbird server.
}