Chat UIKit SwiftUI v3
Chat UIKit SwiftUI
Chat UIKit
SwiftUI
Version 3

Global classes

Copy link

The following shows classes with set values and data that are applied globally to the entire Sendbird Chat SwiftUI.


SBUUser

Copy link

The SBUUser class contains user information for Sendbird Chat SwiftUI. This can be created through User, Member and Sender. The properties of the classes include userId, nickname, and profileURL values. For member types, the isOperator and isMuted properties are also included.

let user = SBUUser(
    userId: {USER_ID},
    nickname: {NICKNAME},
    profileURL: {PROFILE_URL}
)

SBUGlobals

Copy link

SBUGlobals is a global class that allows you to set user data such as applicationId, accessToken, and currentUser and feature data such as imageCompressionRate, and replyType that are used across the entire SwiftUI. You can also decide whether to turn on some features like message grouping and user profile through SBUGlobals.

The values of SBUGlobals must be set before the client app is used. If you need to make changes while the app is running, make sure the values are set before the features are used.

SBUGlobals.currentUser = {USER}
SBUGlobals.isMessageGroupingEnabled = true

SBUGlobalCustomParams

Copy link

You can set global parameters used in group channels and open channels across the SwiftUI through various builders of SBUGlobalCustomParams. The values of SBUGlobalCustomParams must be set before the client app is used. If you need to make changes while the client app is running, make sure the values are set before the features are used.

SBUGlobalCustomParams.groupChannelParamsCreateBuilder = { params in
    params?.isDistinct = true
}

SBUAvailable

Copy link

You can see the attributes that are set in the Sendbird application through the SBUAvailable class.