SendbirdChat
public class SendbirdChat : NSObject
The SendbirdChat
is the core class for Sendbird. This class is singletone instance which is initialized by Application ID.
This class provides the methods for overall operations. The methods include BaseChannelDelegate
registration for receiving events
that are related to channels, ConnectionDelegate
for managing the connection status, updating the current user’s information,
registration for APNS push notification and blocking other users.
-
Gets initializing state.
Declaration
Swift
@objc public class var isInitialized: Bool { get }
Return Value
If
true
,SendbirdChat
instance is initialized. -
Retrieves the SDK version.
Declaration
Swift
@objc public class func getSDKVersion() -> String
Return Value
The SDK version.
-
Gets the Application ID which was used for initialization.
Declaration
Swift
@objc public class func getApplicationId() -> String?
Return Value
The Application ID.
-
Sets the version of the app that uses the Sendbird SDK. The version will be used when the debugging is needed.
Since
3.1.3Declaration
Swift
@objc public class func setAppVersion(version: String?)
Parameters
appVersion
The version of the app.
-
Gets the maximum number of files in a
MultipleFilesMessage
.Since
4.9.1Declaration
Swift
@objc public class func getMultipleFilesMessageFileCountLimit() -> Int
Return Value
multipleFilesMessageFileCountLimit
-
Initializes
SendbirdChat
singleton instance with Sendbird Application ID.The Application ID is on Sendbird dashboard. This method has to be run first in order to user Sendbird.
Since
3.0.227Declaration
Swift
@discardableResult @objc public class func initialize( params: InitParams, migrationStartHandler: VoidHandler? = nil, completionHandler: SBErrorHandler? = nil ) -> Bool
Parameters
params
InitParams
objectmigrationStartHandler
handler that notifies when local cache migration has started
completionHandler
handler that notifies when local cache is ready to use
Return Value
true
if the applicationId is set. -
Synchronously initializes
SendbirdChat
singleton instance with Sendbird Application ID.The Application ID is on Sendbird dashboard. This method has to be run first in order to user Sendbird.
Since
4.0.15Declaration
Swift
@discardableResult @objc public class func initializeSynchronously(params: InitParams) -> SBError?
Parameters
params
InitParams
objectReturn Value
nil
if the applicationId is set, otherwiseSBError
-
Performs a connection to Sendbird with the user ID.
Declaration
Swift
@objc public class func connect( userId: String, completionHandler: UserHandler? = nil )
Parameters
userId
The user ID.
completionHandler
The handler block to execute.
user
is the object to represent the current user. -
Performs a connection to Sendbird with the user ID and the access token.
Declaration
Swift
@objc public class func connect( userId: String, authToken: String?, completionHandler: UserHandler? = nil )
Parameters
userId
The user ID.
authToken
The auth token. If the user doesn’t have auth token, set nil.
completionHandler
The handler block to execute.
user
is the object to represent the current user. -
Performs a connection to Sendbird with the user ID and the access token.
Warning
Important: DON’T use this method. This method will be unavailable.Declaration
Swift
@objc public class func connect( userId: String, authToken: String?, apiHost: String?, wsHost: String?, completionHandler: UserHandler? = nil )
Parameters
userId
user ID
authToken
authToken
apiHost
apiHost
wsHost
wsHost
completionHandler
completionHandler
-
Disconnects from Sendbird. If this method is invoked, the current user will be invalidated.
Declaration
Swift
@objc public class func disconnect(completionHandler: VoidHandler? = nil)
Parameters
completionHandler
The handler block to execute.
-
Disconnects WebSocket only.
Since
4.4.0Declaration
Swift
@objc public class func disconnectWebSocket(completionHandler: VoidHandler? = nil)
Parameters
completionHandler
The handler block to execute.
-
Starts reconnection explictly. The
ConnectionDelegate
delegates will be invoked by the reconnection process.Declaration
Swift
@discardableResult @objc public class func reconnect() -> Bool
Return Value
true
if there is the data to be used for reconnection. -
The completion handler of background session.
Declaration
Swift
@objc public static var backgroundSessionCompletionHandler: VoidHandler? { get set }
-
Gets information set in the Application.
Since
3.0.180Declaration
Swift
@objc public class func getAppInfo() -> AppInfo?
-
Gets the WebSocket server connection state.
Declaration
Swift
@objc public class func getConnectState() -> WebSocketConnectionState
Return Value
WebSocketConnectionState
indicating socket connection state -
Creates
ApplicationUserListQuery
instance for getting a list of all users of this application.Since
3.0.120Declaration
Swift
@objc public class func createApplicationUserListQuery() -> ApplicationUserListQuery
Return Value
ApplicationUserListQuery
instance. -
Creates
ApplicationUserListQuery
instance for getting a list of all users of this application.Since
3.0.120Declaration
Swift
@objc public class func createApplicationUserListQuery( paramsBuilder: (ApplicationUserListQueryParams) -> Void ) -> ApplicationUserListQuery
Parameters
paramsBuilder
The builder closure for setting
ApplicationUserListQueryParams
.Return Value
ApplicationUserListQuery
instance. -
Creates
ApplicationUserListQuery
instance for getting a list of all users of this application.Since
3.0.120Declaration
Swift
@objc public class func createApplicationUserListQuery( params: ApplicationUserListQueryParams ) -> ApplicationUserListQuery
Parameters
params
ApplicationUserListQueryParams
instance.Return Value
ApplicationUserListQuery
instance. -
Creates
BlockedUserListQuery
instance for getting a list of blocked users by the current user.Declaration
Swift
@objc public class func createBlockedUserListQuery() -> BlockedUserListQuery
Return Value
BlockedUserListQuery
instance. -
Creates
BlockedUserListQuery
instance for getting a list of blocked users by the current user.Declaration
Swift
@objc public class func createBlockedUserListQuery( paramsBuilder: (BlockedUserListQueryParams) -> Void ) -> BlockedUserListQuery
Parameters
paramsBuilder
The builder closure for setting
BlockedUserListQueryParams
.Return Value
BlockedUserListQuery
instance. -
Creates
BlockedUserListQuery
instance for getting a list of blocked users by the current user.Declaration
Swift
@objc public class func createBlockedUserListQuery(params: BlockedUserListQueryParams) -> BlockedUserListQuery
Parameters
params
BlockedUserListQueryParams
instance.Return Value
BlockedUserListQuery
instance. -
Creates
MessageSearchQuery
instance for message searchSince
4.0.0Declaration
Swift
@objc public class func createMessageSearchQuery(builder: (MessageSearchQueryParams) -> Void) -> MessageSearchQuery
Parameters
paramsBuilder
The builder closure for setting
MessageSearchQueryParams
Return Value
MessageSearchQuery
instance -
Creates
MessageSearchQuery
instance for message searchSince
4.0.0Declaration
Swift
@objc public class func createMessageSearchQuery(params: MessageSearchQueryParams) -> MessageSearchQuery
Parameters
params
The params object to change query condition.
Return Value
MessageSearchQuery
instance
-
Adds a
ConnectionDelegate
.Declaration
Swift
@available(*, deprecated, renamed: "addConnectionDelegate(_:identifier:﹚", message: "This method is deprecated in 4.0.12.") public class func add(_ delegate: ConnectionDelegate, identifier: String)
Parameters
delegate
ConnectionDelegate
delegate.identifier
The identifier for the delegate.
-
Adds a
ConnectionDelegate
.Since
4.0.12Declaration
Swift
@objc public class func addConnectionDelegate(_ delegate: ConnectionDelegate, identifier: String)
Parameters
delegate
ConnectionDelegate
delegate.identifier
The identifier for the delegate.
-
Removes the
ConnectionDelegate
by identifier.Declaration
Swift
@objc public class func removeConnectionDelegate(forIdentifier identifier: String)
Parameters
identifier
The identifier for the delegate to be removed.
-
Gets the delegate for connection by indentifer.
Declaration
Swift
@objc public class func connectionDelegate( forIdentifier identifier: String ) -> ConnectionDelegate?
Parameters
identifier
The identifier for delegate.
Return Value
ConnectionDelegate
delegate. -
Removes all connection delegates;
Declaration
Swift
@objc public class func removeAllConnectionDelegates()
-
Adds a
BaseChannelDelegate
.Declaration
Swift
@available(*, deprecated, renamed: "addChannelDelegate(_:identifier:﹚", message: "This method is deprecated in 4.0.12.") public class func add(_ delegate: BaseChannelDelegate, identifier: String)
Parameters
delegate
BaseChannelDelegate
delegate.identifier
The identifier for delegate.
-
Adds a
BaseChannelDelegate
.Since
4.0.12Declaration
Swift
@objc public class func addChannelDelegate(_ delegate: BaseChannelDelegate, identifier: String)
Parameters
delegate
BaseChannelDelegate
delegate.identifier
The identifier for delegate.
-
Removes the
BaseChannelDelegate
by identifier.Declaration
Swift
@objc public class func removeChannelDelegate(forIdentifier identifier: String)
Parameters
identifier
The identifier for the delegate to be removed.
-
Gets the delegate for channel by indentifer.
Declaration
Swift
@objc public class func channelDelegate( forIdentifier identifier: String ) -> BaseChannelDelegate?
Parameters
identifier
The identifier for delegate.
Return Value
BaseChannelDelegate
delegate. -
Removes all channel delegates
Declaration
Swift
@objc public class func removeAllChannelDelegates()
-
Gets a
UserEventDelegate
Declaration
Swift
@objc public class func userEventDelegate( forIdentifier identifier: String ) -> UserEventDelegate?
Parameters
identifier
Identifier for delegate
Return Value
UserEventDelgate
if exists -
Adds a
UserEventDelegate
Declaration
Swift
@available(*, deprecated, renamed: "addUserEventDelegate(_:identifier:﹚", message: "This method is deprecated in 4.0.12.") public class func add(_ delegate: UserEventDelegate, identifier: String)
Parameters
delegate
UserEventDelegate
instanceidentifier
String identifier for the delegate
-
Adds a
UserEventDelegate
Since
4.0.12Declaration
Swift
@objc public class func addUserEventDelegate(_ delegate: UserEventDelegate, identifier: String)
Parameters
delegate
UserEventDelegate
instanceidentifier
String identifier for the delegate
-
Removes a
UserEventDelegate
Declaration
Swift
@objc public class func removeUserEventDelegate(forIdentifier identifier: String)
Parameters
identifier
String identifier for the delegate
-
Removes all registered user event delegates
Declaration
Swift
@objc public class func removeAllUserEventDelegates()
-
Adds a
SessionDelegate
Declaration
Swift
@objc public class func setSessionDelegate(_ delegate: SessionDelegate)
Parameters
delegate
SessionDelegate
instance -
Removes the
SessionDelegate
Declaration
Swift
@objc public class func removeSessionDelegate()
-
Gets the pending push token.
Declaration
Swift
@objc public class func getPendingPushToken() -> Data?
Return Value
Returns the pending push token.
-
Registers the current device token to Sendbird.
Declaration
Swift
@objc public class func registerDevicePushToken( _ devToken: Data, unique: Bool, completionHandler: ((_ registrationStatus: PushTokenRegistrationStatus, _ error: SBError?) -> Void)? = nil )
Parameters
devToken
Device token for APNS.
unique
If
true
, register device token after removing exsiting all device tokens of the current user. Iffalse
, just add the device token.completionHandler
The handler block to execute.
status
is the status for push token registration. It is defined inPushTokenRegistrationStatus
..success
represents thedevToken
is registered..pending
represents thedevToken
is not registered because the connection is not established, so this method has to be invoked withgetPendingPushToken
method after the connection. ThedevToken
is retrived bygetPendingPushToken
..error
represents the push token registration is failed. -
Unregisters the current device token from Sendbird.
Declaration
Swift
@available(*, deprecated, message: "This method is deprecated in 4.2.4. Please use `unregisterPushToken(_ pushToken: Data, completionHandler: SBErrorHandler?﹚`") @objc public class func unregisterPushToken( _ devToken: Data, completionHandler: ((_ response: [AnyHashable: Any]?, _ error: SBError?) -> Void)? = nil )
Parameters
devToken
Device token for APNS.
completionHandler
The handler block to execute.
-
Unregisters the current device token from Sendbird.
Declaration
Swift
@objc(unregisterPushToken:completion:) public class func unregisterPushToken( _ pushToken: Data, completionHandler: SBErrorHandler? = nil )
Parameters
devToken
Device token for APNS.
completionHandler
The handler block to execute.
-
Unregisters all device tokens for the current user from Sendbird.
Declaration
Swift
@available(*, deprecated, message: "This method is deprecated in 4.2.4. Please use `unregisterAllPushToken(completionHandler: SBErrorHandler?﹚`") @objc public class func unregisterAllPushToken( completionHandler: ((_ response: [AnyHashable: Any]?, _ error: SBError?) -> Void)? = nil )
Parameters
completionHandler
The handler block to execute.
-
Unregisters all device tokens for the current user from Sendbird.
Declaration
Swift
@objc(unregisterAllPushTokenWithCompletion:) public class func unregisterAllPushToken( completionHandler: SBErrorHandler? = nil )
Parameters
completionHandler
The handler block to execute.
-
Requests device push tokens list of current user after the token.
Since
3.0.134Declaration
Swift
@objc(getMyPushTokensWithToken:pushTokenType:completionHandler:) public class func getMyPushTokens( token: String?, pushTokenType: PushTokenType, completionHandler: @escaping GetPushTokensHandler )
Parameters
token
The token used to get next pagination of deive push tokens.
pushTokenType
The enum type to represent the type of push token.
completionHandler
The 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.
-
Sets Do-not-disturb. This method make snooze(or stop snooze) repeatedly. If you want to snooze specific period, use
setSnoozePeriodEnable(:startTimestamp:endTimestamp:completionHandler:)
.Declaration
Swift
@objc public class func setDoNotDisturb( enable: Bool, startHour: Int32, startMin: Int32, endHour: Int32, endMin: Int32, timezone: String, completionHandler: SBErrorHandler? = nil )
Parameters
enable
Enables or not.
startHour
Start hour.
startMin
Start minute.
endHour
End hour.
endMin
End minute.
timezone
Sets timezone.
completionHandler
The handler block to execute.
-
Gets Do-not-disturb.
Declaration
Swift
@objc public class func getDoNotDisturb( completionHandler: ((_ enabled: Bool, _ startHour: Int, _ startMin: Int, _ endHour: Int, _ endMin: Int, _ timezone: String, _ error: SBError?) -> Void)? = nil )
Parameters
completionHandler
The handler block to execute.
-
Makes a current user snooze/receive remote push notification in specific duration.
If you use
SendbirdChat setDoNotDisturb(enable:startHour:startMin:endHour:endMin:timezone:completionHandler:)
method as well, both methods are applied together. Keep in mind snoozing(or stop snoozing) is applied from this method only once, not repeatedly. If you want to snooze(do not disturb) repeatedly, useSendbirdChat setDoNotDisturb(enable:startHour:startMin:endHour:endMin:timezone:completionHandler:)
.Since
3.0.128Declaration
Swift
@objc public class func setSnoozePeriod( enabled: Bool, startTimestamp: Int64, endTimestamp: Int64, completionHandler: SBErrorHandler? = nil )
Parameters
enabled
Enabled means snooze remote push notification in duration. If set to disabled, current user can ///receive remote push notification.
startTimestamp
Unix timestamp to start snooze.
endTimestamp
Unix timestamp to end snooze.
completionHandler
The handler block to execute when setting notification snoozed is complete.
-
Requests whether the current user snooze remote push notification.
Since
3.0.128Declaration
Swift
@objc public class func getSnoozePeriod( _ completionHandler: @escaping SnoozePeriodHandler )
Parameters
completionHandler
The handler block to execute when setting notification snoozed is complete.
-
Changes a setting that decides which push notification for the current user to receive in all of the group channel.
Since
3.0.128Declaration
Swift
@objc public class func setPushTriggerOption( _ pushTriggerOption: PushTriggerOption, completionHandler: SBErrorHandler? = nil )
Parameters
pushTriggerOption
The options to choose which push notification for the current user to receive.
completionHandler
The handler block to execute when setting a push trigger option of the current ///user is completed.
-
Requests a setting that decides which push notification for the current user to receive in all of the group channel.
Since
3.0.128Declaration
Swift
@objc public class func getPushTriggerOption( completionHandler: @escaping PushTriggerOptionHandler )
Parameters
completionHandler
The handler block to execute when getting a push trigger of the current user is ///completed.
-
Sets push sound
Declaration
Swift
@objc public class func setPushSound( _ sound: String, completionHandler: SBErrorHandler? = nil )
Parameters
sound
Push sound
completionHandler
The handler block to be executed after set push sound.
-
Gets push shound
Declaration
Swift
@objc public class func getPushSound( completionHandler: ((_ pushSound: String?, _ error: SBError?) -> Void)? = nil )
Parameters
completionHandler
The handler block to execute.
-
Sets a push template of the current user.
Declaration
Swift
@objc public class func setPushTemplate( name: String, completionHandler: SBErrorHandler? = nil )
Parameters
name
The name of push template. Uses
SendbirdChat.PushTemplate
constantscompletionHandler
The handler block to execute.
-
Gets a push template of the current user.
Declaration
Swift
@objc public class func getPushTemplate( completionHandler: ((_ pushTemplate: String?, _ error: SBError?) -> Void)? = nil )
Parameters
completionHandler
The handler block to execute. The
name
is the current user’s push template. -
Sets group channel invitation preference for auto acceptance.
Declaration
Swift
@objc public class func setChannelInvitationPreference( autoAccept: Bool, completionHandler: SBErrorHandler? = nil )
Parameters
autoAccept
If
true
, the current user will accept the group channel invitation automatically.completionHandler
The handler block to execute.
-
Gets group channel inviation preference for auto acceptance.
Declaration
Swift
@objc public class func getChannelInvitationPreferenceAutoAccept( completionHandler: ((_ autoAccept: Bool, _ error: SBError?) -> Void)? = nil )
Parameters
completionHandler
The handler block to execute.
-
Creates
FriendListQuery
instance for friend listSince
4.0.0Declaration
Swift
@objc public class func createFriendListQuery() -> FriendListQuery
Return Value
FriendListQuery
instance -
Creates
FriendListQuery
instance for friend listSince
4.0.0Declaration
Swift
@objc public class func createFriendListQuery(paramsBuilder: (FriendListQueryParams) -> Void) -> FriendListQuery
Parameters
paramsBuilder
The builder closure for setting
FriendListQueryParams
.Return Value
FriendListQuery
instance -
Creates
FriendListQuery
instance for friend listSince
4.0.0Declaration
Swift
@objc public class func createFriendListQuery(params: FriendListQueryParams) -> FriendListQuery
Parameters
params
The params object to change query condition.
Return Value
FriendListQuery
instance -
Sets current user to be discoverable by others
Since
3.0.205Declaration
Swift
@objc public class func setAllowFriendDiscovery( _ allow: Bool, completionHandler: SBErrorHandler? = nil )
Parameters
allow
if
true
, current user will be set to discoverable by others -
Gets a flag whether current user is discoverable or not by others
Since
3.0.205Declaration
Swift
@objc public class func getAllowFriendDiscovery( completionHandler: ((_ allowFriendDiscovery: Bool, _ error: SBError?) -> Void)? = nil )
-
Deletes a given user ID from friend list
Declaration
Swift
@objc public class func deleteFriend( userId: String, completionHandler: SBErrorHandler? = nil )
Parameters
userId
user ID
completionHandler
completion handler
-
Deletes a given list of user from friend list
Declaration
Swift
@objc public class func deleteFriends( userIds: [String], completionHandler: SBErrorHandler? = nil )
Parameters
userIds
user ID list
completionHandler
completion handler
-
Deletes a friend with given discovery key
Declaration
Swift
@objc public class func deleteFriend( discoveryKey: String, completionHandler: SBErrorHandler? = nil )
Parameters
discoveryKey
discovery key that associates with friend
completionHandler
completion handler
-
Deletes list of friends with given discovery keys
Declaration
Swift
@objc public class func deleteFriends( discoveryKeys: [String], completionHandler: SBErrorHandler? = nil )
Parameters
discoveryKeys
list of discovery key that associates with friends
completionHandler
completion handler
-
Uploads discovery key and corresponding name
Declaration
Swift
@objc public class func uploadFriendDiscoveries( _ discoveryKeyAndNames: [String: String], completionHandler: SBErrorHandler? = nil )
Parameters
discoveryKeyAndNames
a dictionary contains discovery key as key and name as value
completionHandler
completion handler
-
Fetches friends’ change log
Declaration
Parameters
token
a string to pagniate next page
completionHandler
completion handler
-
Gets the number of group channel with the filter.
Since
3.0.116Declaration
Swift
@objc(getGroupChannelCountWithMyMemberStateFilter:completionHandler:) public class func getGroupChannelCount( myMemberStateFilter: MyMemberStateFilter, completionHandler: @escaping CountHandler )
Parameters
myMemberStateFilter
The member state of the current user in the channels that are counted.
completionHandler
The handler block to execute.
-
Gets the total unread channel count of all group channels.
Since
3.0.116Declaration
Swift
@objc public class func getTotalUnreadChannelCount( completionHandler: @escaping CountHandler )
Parameters
completionHandler
The handler block to execute. The
unreadCount
is the total count of unread channels in all of group channel which the current is a member. -
Gets the total unread channel count of all group channels with filters of params.
Since
3.1.7Declaration
Swift
@objc public class func getTotalUnreadChannelCount( params: GroupChannelTotalUnreadChannelCountParams, completionHandler: @escaping CountHandler )
-
Gets the number of unread messages in group channels.
Since
3.0.116Declaration
Swift
@objc public class func getTotalUnreadMessageCount( completionHandler: @escaping CountHandler )
Parameters
completionHandler
The handler block to execute. The
unreadCount
is the total count of unread messages in all of group channel which the current is a member. -
Gets the total unread message count of the channels with filters of params.
Since
3.0.116Declaration
Swift
@available(*, deprecated, renamed: "getTotalUnreadMessageCountWithFeed(params:completionHandler:﹚", message: "This method is deprecated in 4.6.0.") @objc public class func getTotalUnreadMessageCount( params: GroupChannelTotalUnreadMessageCountParams, completionHandler: @escaping CountHandler )
Parameters
params
The instance of parameters to filter.
completionHandler
The handler block to be executed after getting total unread message count. This block has no return value and takes two argument, the one is the number of unread message and the other is error.
-
Gets the total unread message count of the channels with filters of params.
Since
4.6.0Declaration
Swift
@objc public class func getTotalUnreadMessageCountWithFeed( params: GroupChannelTotalUnreadMessageCountParams, completionHandler: @escaping UnreadMessageCountHandler )
Parameters
params
The instance of parameters to filter.
completionHandler
The handler block to be executed after getting total unread message count. This block has no return value and takes two argument, the one is the number of unread message and the other is error.
-
Gets unread counts of message and invitation counts in super and non_super channels.
Since
3.0.116
Declaration
Swift
@objc public class func getUnreadItemCount( key: UnreadItemKey, completionHandler: @escaping (_ count: UnreadItemCount?, _ error: SBError?) -> Void )
Parameters
key
UnreadItemKey
optionSets to contain count flagscompletionHandler
The handler block to be executed after getting unread item count. This block has no return value and takes two argument. the one is type of UnreadItemCount that contains unsinged interger for count you requested. the other is an error made when there is something wrong to response.
-
Gets total unread message count for current user
Declaration
Swift
@objc public class func getSubscribedTotalUnreadMessageCount() -> Int
-
Gets total unread message count that is subscribed with custom types for current user
Declaration
Swift
@objc public class func getSubscribedCustomTypeTotalUnreadMessageCount() -> Int
-
Gets unread message count on channels with given custom type for current user
Declaration
Swift
@objc public class func getSubscribedCustomTypeUnreadMessageCount( customType: String ) -> Int
-
Marks as read all group channels of the current user.
Declaration
Swift
@objc public class func markAsReadAll(completionHandler: SBErrorHandler? = nil)
Parameters
completionHandler
The handler block to execute.
-
Marks as read some group channels of the current user.
Declaration
Swift
@objc public class func markAsRead( channelURLs: [String], completionHandler: SBErrorHandler? = nil )
Parameters
channelURLs
The array list with channel urls to be marked as read.
completionHandler
The handler block to execute.
-
Marks as delivered with the payload of the remote notification.
Since
3.0.183Declaration
Swift
@objc public class func markAsDelivered( remoteNotificationPayload: [AnyHashable: Any], completionHandler: SBErrorHandler? = nil )
Parameters
remoteNotificationPayload
The remote notification payload
completionHandler
The handler block to execute
-
Requests updated channels and deleted channel URLs since a certain time. A certain time is decided by a token.
Since
3.0.182Declaration
Swift
@objc(getMyGroupChannelChangeLogsWithToken:params:completionHandler:) public class func getMyGroupChannelChangeLogs( token: String?, params: GroupChannelChangeLogsParams = GroupChannelChangeLogsParams(), completionHandler: @escaping ChannelChangeLogsHandler )
Parameters
token
The token used to get next pagination of changelogs.
params
the parameter object that filters a result. See
GroupChannelChangeLogsParams
for more detailcompletionHandler
The handler type of
ChannelChangeLogsHandler
block to execute. TheupdatedChannels
is the channels that were updated. ThedeletedChannelURLs
is the list of the deleted channel URLs. If there are more changelogs that are not returned yet, thehasMore
istrue
. Thetoken
can be used to get more changedlogs. -
Requests updated channels and deleted channel URLs since the timestamp.
Since
3.0.182Declaration
Swift
@objc(getMyGroupChannelChangeLogsWithTimestamp:params:completionHandler:) public class func getMyGroupChannelChangeLogs( timestamp: Int64, params: GroupChannelChangeLogsParams = GroupChannelChangeLogsParams(), completionHandler: @escaping ChannelChangeLogsHandler )
Parameters
timestamp
The number of milli-seconds(msec). Requests changelogs from that time. This value must not be ///negative.
params
the parameter object that filters a result. See
GroupChannelChangeLogsParams
for more detailcompletionHandler
The handler type of
ChannelChangeLogsHandler
block to execute. TheupdatedChannels
is the channels that were updated. ThedeletedChannelURLs
is the list of the deleted channel URLs. If there are more changelogs that are not returned yet, thehasMore
istrue
. Thetoken
can be used to get more changedlogs.
-
Retrieves the log level.
Declaration
Swift
@objc public class func getLogLevel() -> LogLevel
Return Value
Log level.
-
Gets mime type of file.
Declaration
Swift
@objc public class func getMimeType(_ file: Data?) -> String?
Parameters
file
File to get mime type.
Return Value
Returns mime type of the file.
-
Turns on or off the reconnection by network awareness.
Declaration
Swift
@objc public class func setNetworkAwarenessReconnection(_ isOn: Bool)
Parameters
isOn
If
true
, the reconnection by network Awareness is turned. -
Sendbird user agent information getter.
Declaration
Swift
@objc public class func getSBUserAgent() -> String
-
Initialize
sharedContainerIdentifier
of NSURLSessionConfiguration to use background session.Important
If you use
App Extension
and use upload file message in extension, you MUST set thie field.Declaration
Swift
@objc public class func setSharedContainerIdentifier(_ identifier: String)
Parameters
identifier
The identifier to set background session configuraion.
-
Sets dispatch queue for every completion handler and delegate. Default queue is the main queue.
Declaration
Swift
@objc public class func setCompletionHandlerDelegateQueue(_ queue: DispatchQueue)
Parameters
queue
Dispatch queue for every completion handler and delegate.
-
Runs block in the dispatch queue that was set by
setCompletionHandlerDelegateQueue(_:)
.Declaration
Swift
@objc public class func performCompletionHandlerDelegateQueue(_ block: (() -> Void)? = nil)
Parameters
block
Block to run.
-
Sets the app group.
Since
3.0.183Declaration
Swift
@objc public class func setAppGroup(_ appGroup: String)
Parameters
appGroup
The app group.
-
Gets the key to authenticate the file URL.
This has to be put into the HTTP header when the client needs to access it.
Since
3.0.194Declaration
Swift
@objc public class func ekey() -> String?
Return Value
The key to authenticate the file URL
-
Requests a emoji container which contains hash and list of emoji category.
Since
3.0.180Declaration
Swift
@objc public class func getAllEmojis( _ completionHandler: ((_ emojiContainer: EmojiContainer?, _ error: SBError?) -> Void)? = nil )
Parameters
completionHandler
The handler block to execute after request is completed
-
Requests updated channels and deleted channel URLs since the timestamp.
Since
3.0.180Declaration
Parameters
emojiKey
The emoji key
completionHandler
The handler block to execute after request is completed
-
Requests updated channels and deleted channel URLs since the timestamp.
Since
3.0.180Declaration
Swift
@objc public class func getEmojiCategory( _ categoryId: Int64, completionHandler: ((_ emojiCategory: EmojiCategory?, _ error: SBError?) -> Void)? = nil )
Parameters
categoryId
The category ID
completionHandler
The handler block to execute after request is completed
-
Gets the current user object.
The object is valid when the connection succeeded.
Declaration
Swift
@objc public class func getCurrentUser() -> User?
Return Value
The current user object.
-
Gets the current user’s latest connection millisecond time(UTC).
If the connection state is not public, Returns 0.
Since
3.0.117Declaration
Swift
@objc public class func getLastConnectedAt() -> Int64
Return Value
latest connected millisecond time stamp.
-
Updates the current user’s information
Since
4.0.0Declaration
Swift
@objc public class func updateCurrentUserInfo( params: UserUpdateParams, progressHandler: ProgressHandler? = nil, completionHandler: SBErrorHandler? = nil )
-
Updates the current user’s preferred languages
Declaration
Swift
@objc public class func updateCurrentUserInfo( preferredLanguages: [String], completionHandler: SBErrorHandler? = nil )
Parameters
preferredLanguages
New array of preferred languages
completionHandler
The handler block to execute.
-
Blocks the specified user.
Declaration
Swift
@objc public class func blockUserId( _ userId: String, completionHandler: UserHandler? = nil )
Parameters
userId
The user ID to be blocked.
completionHandler
The handler block to execute.
blockedUser
is the blocked user by the current user. -
Blocks the specified user.
Declaration
Swift
@objc public class func blockUser( _ user: User, completionHandler: UserHandler? = nil )
Parameters
user
The user to be blocked.
completionHandler
The handler block to execute.
blockedUser
is the blocked user by the current user. -
Unblocks the specified user.
Declaration
Swift
@objc public class func unblockUserId( _ userId: String, completionHandler: SBErrorHandler? = nil )
Parameters
userId
The user ID which was blocked.
completionHandler
The handler block to execute.
-
Unblocks the specified user.
Declaration
Swift
@objc public class func unblockUser( _ user: User, completionHandler: SBErrorHandler? = nil )
Parameters
user
The user who was blocked.
completionHandler
The handler block to execute.
-
Creates a group channel collection
Declaration
Swift
@objc public class func createGroupChannelCollection( query: GroupChannelListQuery ) -> GroupChannelCollection?
Parameters
query
GroupChannelListQuery
instanceReturn Value
GroupChannelCollection
instance -
Creates a message collection
Declaration
Swift
@objc public class func createMessageCollection( channel: GroupChannel, startingPoint: Int64, params: MessageListParams ) -> MessageCollection
Parameters
channel
GroupChannel
instancestartingPoint
Epoch timestamp that will be used as pivot point to fetch messages
params
MessageListParams
instance -
Since
4.6.0Declaration
Swift
@objc open class func createNotificationCollection( channel: FeedChannel, startingPoint: Int64, params: MessageListParams, delegate: NotificationCollectionDelegate? ) -> NotificationCollection?
-
Clears local cached data
Declaration
Swift
@objc public class func clearCachedData(completionHandler: SBErrorHandler?)
-
Clears local cached message
Declaration
Swift
@objc public class func clearCachedMessages(channelURL: String, completionHandler: SBErrorHandler?)
-
Returns local cached data size in byte
Declaration
Swift
@objc public class func getCachedDataSize() -> Int
Return Value
cached data size
-
Checks if local caching is enabled.
Since
3.1.0Declaration
Swift
@objc public static var isLocalCachingEnabled: Bool { get }
-
Gets the number of scheduled messages.
Since
4.0.0Declaration
Swift
@objc public class func getTotalScheduledMessageCount( params: TotalScheduledMessageCountParams, completionHandler: @escaping CountHandler )
Parameters
params
The object that contains a set of options to get scheduled messages.
completionHandler
The handler block to be executed after the total scheduled message count in the channel is fetched or an error occurs.
-
Creates
ScheduledMessageListQuery
for getting the list of scheduled messages.Since
4.0.0Declaration
Swift
@objc public class func createScheduledMessageListQuery( channelURL: String? ) -> ScheduledMessageListQuery
Parameters
channelURL
The channel URL. If
channelURL
is nil, you will get scheduled messages for all channels.Return Value
The scheduled message list query object.
-
Creates
ScheduledMessageListQuery
for getting the list of scheduled messages.Since
4.0.0Declaration
Swift
@objc public class func createScheduledMessageListQuery( channelURL: String?, paramsBuilder: (ScheduledMessageListQueryParams) -> Void ) -> ScheduledMessageListQuery
Parameters
channelURL
The channel URL. If
channelURL
is nil, you will get scheduled messages for all channels.paramsBuilder
The builder closure for setting
ScheduledMessageListQueryParams
.Return Value
The scheduled message list query object.
-
Creates
ScheduledMessageListQuery
for getting the list of scheduled messages.Since
4.0.0Declaration
Swift
@objc public class func createScheduledMessageListQuery( channelURL: String?, params: ScheduledMessageListQueryParams ) -> ScheduledMessageListQuery
Parameters
channelURL
The channel URL. If
channelURL
is nil, you will get scheduled messages for all channels.params
The params object to change query condition.
Return Value
The scheduled message list query object.
-
Creates
PollListQuery
Since
4.1.0Declaration
Swift
@objc public class func createPollListQuery(params: PollListQueryParams) -> PollListQuery
Parameters
params
The params object to change query condition.
Return Value
PollListQuery
instance -
Creates
PollListQuery
Since
4.1.0Declaration
Swift
@objc public class func createPollListQuery(paramsBuilder: (PollListQueryParams) -> Void) -> PollListQuery
Parameters
params
The params object to change query condition.
Return Value
PollListQuery
instance. -
Creates
PollVoterListQuery
Since
4.1.0Declaration
Swift
@objc public class func createPollVoterListQuery(params: PollVoterListQueryParams) -> PollVoterListQuery
Parameters
params
The params object to change query condition.
Return Value
PollVoterListQuery
instance. -
Creates
PollVoterListQuery
with paramsBuilder.Declaration
Swift
@objc public class func createPollVoterListQuery(paramsBuilder: (PollVoterListQueryParams) -> Void) -> PollVoterListQuery
Parameters
paramsBuilder
The builder closure for setting
GroupChannelListQueryParams
.Return Value
GroupChannelListQuery instance for the current user.
-
Requests updated feed channels and deleted feed channel URLs since a certain time. A certain time is decided by a timestamp.
Since
4.6.0Declaration
Swift
@objc public class func getMyFeedChannelChangeLogs( timestamp: Int64, params: FeedChannelChangeLogsParams = FeedChannelChangeLogsParams(), completionHandler: @escaping FeedChannelChangeLogsHandler )
Parameters
token
The token used to get next pagination of changelogs.
params
the parameter object that filters a result. See
FeedChannelChangeLogsParams
for more detailcompletionHandler
The handler type of
FeedChannelChangeLogsHandler
block to execute. TheupdatedChannels
is the channels that were updated. ThedeletedChannelURLs
is the list of the deleted channel URLs. If there are more changelogs that are not returned yet, thehasMore
istrue
. Thetoken
can be used to get more changedlogs. -
Requests updated feed channels and deleted feed channel URLs since a certain time. A certain time is decided by a token.
Since
4.6.0Declaration
Swift
@objc public class func getMyFeedChannelChangeLogsByToken( token: String?, params: FeedChannelChangeLogsParams = FeedChannelChangeLogsParams(), completionHandler: @escaping FeedChannelChangeLogsHandler )
Parameters
token
The token used to get next pagination of changelogs.
params
the parameter object that filters a result. See
FeedChannelChangeLogsParams
for more detailcompletionHandler
The handler type of
FeedChannelChangeLogsHandler
block to execute. TheupdatedChannels
is the channels that were updated. ThedeletedChannelURLs
is the list of the deleted channel URLs. If there are more changelogs that are not returned yet, thehasMore
istrue
. Thetoken
can be used to get more changedlogs. -
Since
4.6.0Declaration
Swift
@objc public class func getUnreadMessageCount() -> UnreadMessageCount
-
Since
4.6.0Declaration
Swift
@objc public class func getGlobalNotificationChannelSetting( completionHandler: @escaping GlobalNotificationChannelSettingHandler )
-
Since
4.6.0Declaration
Swift
@objc public class func getNotificationTemplateList( token: String?, params: NotificationTemplateListParams = NotificationTemplateListParams(), completionHandler: @escaping NotificationTemplateListHandler )
-
Since
4.6.0Declaration
Swift
@objc public class func getNotificationTemplate( key: String, completionHandler: @escaping NotificationTemplateHandler )
-
Since
4.8.4Declaration
Swift
public class func __getUIKitConfiguration( completionhandler: @escaping UIKitConfigurationHandler )
-
Undocumented
See moreDeclaration
Swift
@objc(SBDPushTemplate) class PushTemplate : NSObject
-
Used to set the version information of the Sendbird SDK extension.
Declaration
Swift
@objc public class func __addExtension(_ key: String, version: String)
Parameters
key
Extension sdk’s hidden key
version
Extension sdk’s version string
-
Used to set the version information of the Sendbird SDK extension.
Declaration
Swift
@available(*, deprecated, renamed: "__addExtension(_:version:﹚", message: "This method is deprecated in 4.8.3") @objc public class func addExtension(_ key: String, version: String)
Parameters
key
Extension sdk’s hidden key
version
Extension sdk’s version string
-
Used to set the version information of the Sendbird SDK extensions in user agent.
Since
4.8.5Declaration
Swift
public class func __addSendbirdExtensions(extensions: [__SendbirdSDKInfo], customData: [String : String]?) -> Bool
Parameters
extensions
A non-empty array of extension SDKs’ versions.
customData
Custom data in String to add in user agent.
Return Value
false if extensions don’t satisfy Semantic Versioning or custom data includes “&” or “=”.