Global classes
The following shows classes with set values and data that are applied globally to the entire Sendbird Chat SwiftUI.
SBUUser
The SBUUser
class encapsulates user information for Sendbird Chat's SwiftUI UIKit. This class can be created using the User, Member, or Sender classes.
List of properties
Properties
Required | Type | Description |
---|---|---|
userId | String | Specifies the unique ID of the user. |
Optional | Type | Description |
---|---|---|
nickname | String? | Specifies the user's nickname. (Default: |
profileURL | String? | Specifies the URL of the user's profile image. (Default: |
isOperator | Bool | Specifies the user is an operator. (Default: |
isMuted | Bool | Specifies the user is muted in the channel. (Default: |
Note: For a comprehensive list of properties and details, refer to the SBUUser official documentation.
Usage Example
Below is an example of initializing and using the SBUUser
class in Swift:
SBUGlobals
SBUGlobals
is a global class that provides configurations and variables for Sendbird UIKit. This includes user data like applicationId
, accessToken
, and currentUser
, as well as feature configurations such as imageCompressionRate
and isMessageGroupingEnabled
. These settings affect the behavior and appearance of the UIKit across your SwiftUI application.
The values in SBUGlobals
should be set before using the client app. If changes are required while the app is running, ensure they are updated before the associated features are utilized.
List of properties
Properties
Name | Type | Description |
---|---|---|
accessToken | String? | Specifies the access token of the user (Default: |
apiHost | String? | Specifies the API host URL to connect to a specific API server |
applicationId | String? | Specifies the application ID from Sendbird dashboard. |
currentUser | Specifies the current User that is type of SBUUser | |
imageCompressionRate | CGFloat | Specifies the image compression rate value that will be used when sending image (Default: |
imageResizingSize | CGSize | Specifies the image resizing size value that will be used when sending image (Default: |
isAVPlayerAlwaysEnabled | Bool | Specifies the audio/video player of file message. If it’s |
isCustomizedIconResizable | Bool | Specifies the resizable of customized icon image. If it’s |
isImageCompressionEnabled | Bool | If this value is enabled, image compression and resizing will be applied when sending a file message (Default: |
isMessageGroupingEnabled | Bool | If this value is enabled, messages sent at similar times are grouped (Default: |
isPHPickerEnabled | Bool | If it’s true, uses |
isTintColorEnabledForCustomizedIcon | Bool | Specifies the Sendbird UIKit uses appropriate tint color options from themes to the customized icon image. If it’s false, all customized icon images used in Sendbird UIKit will ignore tint color options (Default: |
isUserIdUsedForNickname | Bool | Specifies whether a nickname uses a user ID when there is no user nickname based on the user ID |
messageCellConfiguration | Specifies the configuration for message cell. | |
photoLibraryAccessLevel | Specifies the level of access to the photo library (Default: | |
reply | Specifies the configuration for reply. | |
scrollPostionConfiguration | Specifies the configuration for scroll position. | |
userMentionConfig | Specifies the configuration for user mention. | |
voiceMessageConfig | Specifies the configuration for voice message. | |
wsHost | String? | Specifies the WebSocket host URL to connect to a specific WebSocket server |
Note: For a comprehensive list of properties and details, refer to the SBUGlobals official documentation.
Usage Example
Below is an example of how to use SBUGlobals
in your Swift application:
SBUGlobalCustomParams
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.
SBUAvailable
You can see the attributes that are set in the Sendbird application through the SBUAvailable
class.
List of properties
Properties
Name | Type | Description |
---|---|---|
multipleFilesMessageFileCountLimit | Int | The maximum number of files that can be selected when sending a message in GroupChannel. This is decided as the minimum value between the count limit set by the server, and the count limit set by Sendbird UIKit. |
uploadSizeLimitBytes | Int64 | The size limit of a file upload in bytes. |
uploadSizeLimitMB | Int64 | The size limit of a file upload in MB. |
Note: For a comprehensive list of properties and details, refer to the SBUAvailable official documentation.
List of methods
Methods
Name | Parameters | Return Type | Description |
---|---|---|---|
isSupportBroadcastChannel | None | Bool | Checks if the application supports broadcast channels. |
isSupportMessageSearch | None | Bool | Checks if the application supports message search. |
isSupportOgTag | channelType: ChannelType | Bool | Checks if the application supports Open Graph metadata. |
isSupportReactions | None | Bool | Checks if the application supports reactions for Group Channels. |
isSupportReactions | for: SBUChannelType | Bool | Checks if the application supports reactions for the given channel type. |
isSupportSuperGroupChannel | None | Bool | Checks if the application supports super group channels. |
Note: For a comprehensive list of methods and details, refer to the SBUAvailable official documentation.
Usage Example
Below is an example of how to use SBUAvailable
in your Swift application: