Sendbird Chat SDK for Unity
SendbirdChat

Static Public Member Functions

static SbConnectionState GetConnectionState ()
 Gets the SDK connection state. More...
 
static void Init (SbInitParams inInitParams)
 Initializes SendbirdChat with given app ID. More...
 
static void Connect (string inUserId, SbUserHandler inCompletionHandler)
 Performs a connection to Sendbird with the user ID. More...
 
static void Connect (string inUserId, string inAuthToken, SbUserHandler inCompletionHandler)
 Performs a connection to Sendbird with the user ID and the access token. More...
 
static void Connect (string inUserId, string inAuthToken, string inApiHost, string inWsHost, SbUserHandler inCompletionHandler)
 Performs a connection to Sendbird with the user ID and the access token. More...
 
static void Disconnect (SbDisconnectHandler inDisconnectHandler)
 Disconnects from Sendbird. If this method is invoked, the current user will be invalidated. More...
 
static bool Reconnect ()
 Starts reconnection explicitly. The ConnectionDelegate delegates will be invoked by the reconnection process. More...
 
static void SetChannelInvitationPreference (bool inAutoAccept, SbErrorHandler inCompletionHandler)
 Sets group channel invitation preference for auto acceptance. More...
 
static void GetChannelInvitationPreference (SbChannelInvitationPreferenceHandler inCompletionHandler)
 Gets group channel invitation preference for auto acceptance. More...
 
static void SetSessionHandler (SbSessionHandler inSessionHandler)
 Set a SessionHandler which is required for SDK refresh the session when the current session expires. More...
 
static void AddUseEventHandler (string inIdentifier, SbUserEventHandler inUserEventHandler)
 Adds a user event handler. All added handlers will be notified when events occur. More...
 
static void RemoveUserEventHandler (string inIdentifier)
 Removes a user event handler. The deleted handler no longer be notified. More...
 
static void RemoveAllUserEventHandlers ()
 Removes all user event handlers added by AddUseEventHandler. More...
 
static void AddConnectionHandler (string inIdentifier, SbConnectionHandler inConnectionHandler)
 Adds a connection handler. All added handlers will be notified when events occurs. More...
 
static void RemoveConnectionHandler (string inIdentifier)
 Removes a connection handler. The deleted handler no longer be notified. More...
 
static void RemoveAllConnectionHandlers ()
 Removes all connection handlers added by AddConnectionHandler. More...
 
static void BlockUser (string inUserId, SbUserHandler inCompletionHandler)
 Blocks the specified User ID. Blocked User cannot send messages to the blocker. More...
 
static void UnblockUser (string inUserId, SbErrorHandler inCompletionHandler)
 Unblocks the specified User ID. Unblocked User cannot send messages to the ex-blocker. More...
 
static SbApplicationUserListQuery CreateApplicationUserListQuery (SbApplicationUserListQueryParams inParams=null)
 Creates a query instance to get the whole User list. More...
 
static SbBlockedUserListQuery CreateBlockedUserListQuery (SbBlockedUserListQueryParams inParams=null)
 Creates a query instance to get only the blocked User (by me) list. More...
 
static SbMessageSearchQuery CreateMessageSearchQuery (SbMessageSearchQueryParams inParams=null)
 Creates a query instance to search for a message. More...
 
static void UpdateCurrentUserInfo (SbUserUpdateParams inParams, SbErrorHandler inCompletionHandler)
 Updates current User's information. More...
 
static void UpdateCurrentUserInfo (List< string > inPreferredLanguages, SbErrorHandler inCompletionHandler)
 Updates current User's information. More...
 
static void RegisterPushToken (SbPushTokenType inPushTokenType, string inPushToken, bool inUnique, SbPushTokenRegistrationStatusHandler inCompletionHandler)
 Registers push token for the current User to receive push notification. More...
 
static void UnregisterPushToken (SbPushTokenType inPushTokenType, string inPushToken, SbErrorHandler inCompletionHandler)
 Unregisters push token for the current User. More...
 
static void UnregisterAllPushToken (SbErrorHandler inCompletionHandler)
 Unregisters all push token bound to the current User. More...
 
static void GetMyPushTokensByToken (string inToken, SbPushTokenType inPushTokenType, SbPushTokensHandler inCompletionHandler)
 Requests push tokens of current user from given token. The result is passed to handler. More...
 
static void SetPushTemplate (string inTemplateName, SbErrorHandler inCompletionHandler)
 Sets push template option for the current User. More...
 
static void GetPushTemplate (SbPushTemplateHandler inCompletionHandler)
 Gets push template option for the current User. For details of push template option, refer to SetPushTemplate. This can be used, for instance, when you need to check the push notification content preview is on or off at the moment. More...
 
static void SetSnoozePeriod (bool inEnabled, long inStartTimestamp, long inEndTimestamp, SbErrorHandler inCompletionHandler)
 Sets snooze period for the current User. If this option is enabled, the current User does not receive push notification during the given period. It's not a repetitive operation. If you want to snooze repeatedly, use SetDoNotDisturb. More...
 
static void GetSnoozePeriod (SbSnoozePeriodHandler inCompletionHandler)
 Gets snooze period for the current User. More...
 
static void SetDoNotDisturb (bool inEnabled, int inStartHour, int inStartMin, int inEndHour, int inEndMin, string inTimezone, SbErrorHandler inCompletionHandler)
 Sets Do-not-disturb option for the current User. If this option is enabled, the current User does not receive push notification during the specified time repeatedly. If you want to snooze specific period, use SetSnoozePeriod. More...
 
static void GetDoNotDisturb (SbDoNotDisturbHandler inCompletionHandler)
 Gets Do-not-disturb option for the current User. More...
 
static void SetLogLevel (SbLogLevel inLogLevel)
 Sets the log level. The log level is defined by SbLogLevel. More...
 

Properties

static string SDKVersion [get]
 Current SDK version. More...
 
static string OSVersion [get]
 Current OS version. More...
 
static string ApplicationId [get]
 Current application ID. More...
 
static string EKey [get]
 The key to authenticate the url retrieved from SbFileMessage.PlainUrl, SbUser.PlainProfileImageUrl and SbThumbnail.PlainUrl. This key has to be put into the HTTP header to access the url provided by above methods. More...
 
static SbAppInfo AppInfo [get]
 Represents information obtained from the application settings. More...
 
static SbUser CurrentUser [get]
 The current connected User. null if connect is not called. More...
 
static SbGroupChannelModule GroupChannel [get]
 SbGroupChannelModule class. More...
 
static SbOpenChannelModule OpenChannel [get]
 SbOpenChannelModule class. More...
 
static SbMessageModule Message [get]
 SbMessageModule class. More...
 
static SendbirdChatOptions Options [get]
 SendbirdChatOptions class. More...
 

Detailed Description

Since
4.0.0

Member Function Documentation

◆ AddConnectionHandler()

static void AddConnectionHandler ( string  inIdentifier,
SbConnectionHandler  inConnectionHandler 
)
static

Adds a connection handler. All added handlers will be notified when events occurs.

Parameters
inIdentifier
inConnectionHandler
Since
4.0.0

◆ AddUseEventHandler()

static void AddUseEventHandler ( string  inIdentifier,
SbUserEventHandler  inUserEventHandler 
)
static

Adds a user event handler. All added handlers will be notified when events occur.

Parameters
inIdentifier
inUserEventHandler
Since
4.0.0

◆ BlockUser()

static void BlockUser ( string  inUserId,
SbUserHandler  inCompletionHandler 
)
static

Blocks the specified User ID. Blocked User cannot send messages to the blocker.

Parameters
inUserId
inCompletionHandler
Since
4.0.0

◆ Connect() [1/3]

static void Connect ( string  inUserId,
SbUserHandler  inCompletionHandler 
)
static

Performs a connection to Sendbird with the user ID.

Parameters
inUserIdThe user ID.
inCompletionHandlerThe handler block to execute. user is the object to represent the current user.
Since
4.0.0

◆ Connect() [2/3]

static void Connect ( string  inUserId,
string  inAuthToken,
SbUserHandler  inCompletionHandler 
)
static

Performs a connection to Sendbird with the user ID and the access token.

Parameters
inUserIdThe user ID.
inAuthTokenThe auth token. If the user doesnt have auth token, set nil.
inCompletionHandlerThe handler block to execute. user is the object to represent the current user.
Since
4.0.0

◆ Connect() [3/3]

static void Connect ( string  inUserId,
string  inAuthToken,
string  inApiHost,
string  inWsHost,
SbUserHandler  inCompletionHandler 
)
static

Performs a connection to Sendbird with the user ID and the access token.

Parameters
inUserIdThe user ID.
inAuthTokenThe auth token. If the user doesnt have auth token, set nil.
inApiHostapiHost
inWsHostwsHost
inCompletionHandlerThe handler block to execute. user is the object to represent the current user.
Since
4.0.0

◆ CreateApplicationUserListQuery()

static SbApplicationUserListQuery CreateApplicationUserListQuery ( SbApplicationUserListQueryParams  inParams = null)
static

Creates a query instance to get the whole User list.

Since
4.0.0

◆ CreateBlockedUserListQuery()

static SbBlockedUserListQuery CreateBlockedUserListQuery ( SbBlockedUserListQueryParams  inParams = null)
static

Creates a query instance to get only the blocked User (by me) list.

Parameters
inParams
Returns
Since
4.0.0

◆ CreateMessageSearchQuery()

static SbMessageSearchQuery CreateMessageSearchQuery ( SbMessageSearchQueryParams  inParams = null)
static

Creates a query instance to search for a message.

Parameters
inParams
Returns
Since
4.0.0

◆ Disconnect()

static void Disconnect ( SbDisconnectHandler  inDisconnectHandler)
static

Disconnects from Sendbird. If this method is invoked, the current user will be invalidated.

Parameters
inDisconnectHandlerThe handler block to execute.
Since
4.0.0

◆ GetChannelInvitationPreference()

static void GetChannelInvitationPreference ( SbChannelInvitationPreferenceHandler  inCompletionHandler)
static

Gets group channel invitation preference for auto acceptance.

Parameters
inCompletionHandlerThe handler block to execute.
Since
4.0.0

◆ GetConnectionState()

static SbConnectionState GetConnectionState ( )
static

Gets the SDK connection state.

Since
4.0.0

◆ GetDoNotDisturb()

static void GetDoNotDisturb ( SbDoNotDisturbHandler  inCompletionHandler)
static

Gets Do-not-disturb option for the current User.

Parameters
inCompletionHandler
Since
4.0.0

◆ GetMyPushTokensByToken()

static void GetMyPushTokensByToken ( string  inToken,
SbPushTokenType  inPushTokenType,
SbPushTokensHandler  inCompletionHandler 
)
static

Requests push tokens of current user from given token. The result is passed to handler.

Parameters
inTokenThe token used to get next pagination of device push tokens.
inPushTokenTypeThe enum type to represent the type of push token.
inCompletionHandlerThe handler block to be executed after requests. This block has no return value and takes 5 arguments that are device push token list, push token type you are requesting, boolean that indicates having next pagination, token to be used next pagination and error.
Since
4.0.0

◆ GetPushTemplate()

static void GetPushTemplate ( SbPushTemplateHandler  inCompletionHandler)
static

Gets push template option for the current User. For details of push template option, refer to SetPushTemplate. This can be used, for instance, when you need to check the push notification content preview is on or off at the moment.

Parameters
inCompletionHandler
Since
4.0.0

◆ GetSnoozePeriod()

static void GetSnoozePeriod ( SbSnoozePeriodHandler  inCompletionHandler)
static

Gets snooze period for the current User.

Parameters
inCompletionHandler
Since
4.0.0

◆ Init()

static void Init ( SbInitParams  inInitParams)
static

Initializes SendbirdChat with given app ID.

Parameters
inInitParams
Since
4.0.0

◆ Reconnect()

static bool Reconnect ( )
static

Starts reconnection explicitly. The ConnectionDelegate delegates will be invoked by the reconnection process.

Returns
true if there is the data to be used for reconnection.
Since
4.0.0

◆ RegisterPushToken()

static void RegisterPushToken ( SbPushTokenType  inPushTokenType,
string  inPushToken,
bool  inUnique,
SbPushTokenRegistrationStatusHandler  inCompletionHandler 
)
static

Registers push token for the current User to receive push notification.

Parameters
inPushTokenTypeThe enum type to represent the type of push token.
inPushTokenDevice token.
inUniqueIf true, register device token after removing existing all device tokens of the current user. If false, just add the device token.
inCompletionHandlerThe handler block to execute. status is the status for push token registration. It is defined in SbPushTokenRegistrationStatus.Success represents the devToken is registered. Pending represents the devToken is not registered because the connection is not established, so this method has to be invoked with getPendingPushToken method after the connection. Error represents the push token registration is failed.
Since
4.0.0

◆ RemoveAllConnectionHandlers()

static void RemoveAllConnectionHandlers ( )
static

Removes all connection handlers added by AddConnectionHandler.

Since
4.0.0

◆ RemoveAllUserEventHandlers()

static void RemoveAllUserEventHandlers ( )
static

Removes all user event handlers added by AddUseEventHandler.

Since
4.0.0

◆ RemoveConnectionHandler()

static void RemoveConnectionHandler ( string  inIdentifier)
static

Removes a connection handler. The deleted handler no longer be notified.

Parameters
inIdentifier
Since
4.0.0

◆ RemoveUserEventHandler()

static void RemoveUserEventHandler ( string  inIdentifier)
static

Removes a user event handler. The deleted handler no longer be notified.

Parameters
inIdentifier
Since
4.0.0

◆ SetChannelInvitationPreference()

static void SetChannelInvitationPreference ( bool  inAutoAccept,
SbErrorHandler  inCompletionHandler 
)
static

Sets group channel invitation preference for auto acceptance.

Parameters
inAutoAcceptIf true, the current user will accept the group channel invitation automatically.
inCompletionHandlerThe handler block to execute.
Since
4.0.0

◆ SetDoNotDisturb()

static void SetDoNotDisturb ( bool  inEnabled,
int  inStartHour,
int  inStartMin,
int  inEndHour,
int  inEndMin,
string  inTimezone,
SbErrorHandler  inCompletionHandler 
)
static

Sets Do-not-disturb option for the current User. If this option is enabled, the current User does not receive push notification during the specified time repeatedly. If you want to snooze specific period, use SetSnoozePeriod.

Parameters
inEnabledEnables or not.
inStartHourStart hour.
inStartMinStart minute.
inEndHourEnd hour.
inEndMinEnd minute.
inTimezoneSets timezone.
inCompletionHandlerThe handler block to execute.
Since
4.0.0

◆ SetLogLevel()

static void SetLogLevel ( SbLogLevel  inLogLevel)
static

Sets the log level. The log level is defined by SbLogLevel.

Parameters
inLogLevel
Since
4.0.0

◆ SetPushTemplate()

static void SetPushTemplate ( string  inTemplateName,
SbErrorHandler  inCompletionHandler 
)
static

Sets push template option for the current User.

Parameters
inTemplateNameThe name of push template.
inCompletionHandlerThe handler block to execute.
Since
4.0.0

◆ SetSessionHandler()

static void SetSessionHandler ( SbSessionHandler  inSessionHandler)
static

Set a SessionHandler which is required for SDK refresh the session when the current session expires.

Parameters
inSessionHandler
Since
4.0.0

◆ SetSnoozePeriod()

static void SetSnoozePeriod ( bool  inEnabled,
long  inStartTimestamp,
long  inEndTimestamp,
SbErrorHandler  inCompletionHandler 
)
static

Sets snooze period for the current User. If this option is enabled, the current User does not receive push notification during the given period. It's not a repetitive operation. If you want to snooze repeatedly, use SetDoNotDisturb.

Parameters
inEnabledEnabled means snooze remote push notification in duration. If set to disabled, current user can receive remote push notification.
inStartTimestampUnix timestamp to start snooze.
inEndTimestampUnix timestamp to end snooze.
inCompletionHandlerThe handler block to execute when setting notification snoozed is complete.
Since
4.0.0

◆ UnblockUser()

static void UnblockUser ( string  inUserId,
SbErrorHandler  inCompletionHandler 
)
static

Unblocks the specified User ID. Unblocked User cannot send messages to the ex-blocker.

Parameters
inUserId
inCompletionHandler
Since
4.0.0

◆ UnregisterAllPushToken()

static void UnregisterAllPushToken ( SbErrorHandler  inCompletionHandler)
static

Unregisters all push token bound to the current User.

Parameters
inCompletionHandler
Since
4.0.0

◆ UnregisterPushToken()

static void UnregisterPushToken ( SbPushTokenType  inPushTokenType,
string  inPushToken,
SbErrorHandler  inCompletionHandler 
)
static

Unregisters push token for the current User.

Parameters
inPushTokenType
inPushToken
inCompletionHandler
Since
4.0.0

◆ UpdateCurrentUserInfo() [1/2]

static void UpdateCurrentUserInfo ( List< string >  inPreferredLanguages,
SbErrorHandler  inCompletionHandler 
)
static

Updates current User's information.

Parameters
inPreferredLanguagesNew array of preferred languages
inCompletionHandlerThe handler block to execute.
Since
4.0.0

◆ UpdateCurrentUserInfo() [2/2]

static void UpdateCurrentUserInfo ( SbUserUpdateParams  inParams,
SbErrorHandler  inCompletionHandler 
)
static

Updates current User's information.

Parameters
inParams
inCompletionHandler
Since
4.0.0

Property Documentation

◆ AppInfo

SbAppInfo AppInfo
staticget

Represents information obtained from the application settings.

Since
4.0.0

◆ ApplicationId

string ApplicationId
staticget

Current application ID.

Since
4.0.0

◆ CurrentUser

SbUser CurrentUser
staticget

The current connected User. null if connect is not called.

Since
4.0.0

◆ EKey

string EKey
staticget

The key to authenticate the url retrieved from SbFileMessage.PlainUrl, SbUser.PlainProfileImageUrl and SbThumbnail.PlainUrl. This key has to be put into the HTTP header to access the url provided by above methods.

Since
4.0.0

◆ GroupChannel

SbGroupChannelModule GroupChannel
staticget

SbGroupChannelModule class.

Since
4.0.0

◆ Message

SbMessageModule Message
staticget

SbMessageModule class.

Since
4.0.0

◆ OpenChannel

SbOpenChannelModule OpenChannel
staticget

SbOpenChannelModule class.

Since
4.0.0

◆ Options

SendbirdChatOptions Options
staticget

SendbirdChatOptions class.

Since
4.0.0

◆ OSVersion

string OSVersion
staticget

Current OS version.

Since
4.0.0

◆ SDKVersion

string SDKVersion
staticget

Current SDK version.

Since
4.0.0