OpenChannel
open class OpenChannel: BaseChannel
The OpenChannel class represents a open channel which is a public chat.
Any users who wants to enter the channel can join freely. This class is derived from BaseChannel.
If the OpenChannelDelegate is added, the user will automatically receive all messages from the
channels where the user belongs after connection. The OpenChannel does not provide the features that
GroupChannel does, but it can handle much more users.
For more information, see Group Channel.
-
The number of participants in this channel.
Declaration
Swift
open internal(set) var participantCount: Int = 0 -
The operators of this channel.
Declaration
Swift
open internal(set) var operators: [User]? -
Returns the user is an operator or not.
Declaration
Swift
open func isOperator(user: User) -> BoolParameters
userThe user object.
Return Value
If
true, the user is an operator. -
Returns the user ID is an operator or not.
Declaration
Swift
open func isOperator(userId: String) -> BoolParameters
userIdThe user ID.
Return Value
If
true, the user ID is an operator. -
Default constructor.
Declaration
Swift
public required init(from decoder: Decoder) throwsParameters
decoderDecoderinstance -
Encodes this object.
Declaration
Swift
open override func encode(to encoder: Encoder) throwsParameters
encoderEncoderinstance -
Compares this object with given other object.
Declaration
Swift
public override func isEqual(_ object: Any?) -> BoolParameters
objectAnyinstanceReturn Value
trueif same otherwisefalse
-
Creates an open channel.
Note
The name and cover URL of the channel are generated in Sendbird server.Declaration
Swift
open class func createChannel(completionHandler: @escaping OpenChannelHandler)Parameters
completionHandlerThe handler block to execute.
-
Creates a open channel with
OpenChannelCreateParamsclass.Since
3.0.206Declaration
Swift
open class func createChannel( params: OpenChannelCreateParams, completionHandler: @escaping OpenChannelHandler )Parameters
paramsInstance of
OpenChannelCreateParamswhat has properties to create open channel.completionHandlerHandler block to execute.
channelis the open channel instance. -
Creates a open channel with
OpenChannelCreateParamsclass.Since
3.0.206Declaration
Swift
open class func createChannel( params: OpenChannelCreateParams, progressHandler: ProgressHandler?, completionHandler: @escaping OpenChannelHandler )Parameters
paramsThe parameter instance of
OpenChannelCreateParamswhat has properties to create open channel.progressHandlerThe handler block to monitor progression.
bytesSentis the number of bytes sent since the last time this method was called.totalBytesSentis the total number of bytes sent so far.totalBytesExpectedToSendis the expected length of the body data. These parameters are the same to the declaration ofurlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:).completionHandlerThe handler block to execute.
channelis the open channel instance. -
Updates this channel with
OpenChannelUpdateParamsclass.Since
3.0.206Declaration
Swift
open func update( params: OpenChannelUpdateParams, completionHandler: @escaping OpenChannelHandler )Parameters
paramsThe parameter instance of OpenChannelCreateParams what has properties to update open channel.
completionHandlerThe handler block to execute.
channelis the open channel instance. -
Updates this channel with
OpenChannelUpdateParamsclass.Since
3.0.206Declaration
Swift
open func update( params: OpenChannelUpdateParams, progressHandler: ProgressHandler?, completionHandler: @escaping OpenChannelHandler )Parameters
paramsThe parameter instance of OpenChannelCreateParams what has properties to update open channel.
progressHandlerThe handler block to monitor progression.
bytesSentis the number of bytes sent since the last time this method was called.totalBytesSentis the total number of bytes sent so far.totalBytesExpectedToSendis the expected length of the body data. These parameters are the same to the declaration ofurlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:).completionHandlerThe handler block to execute.
channelis the open channel instance. -
Deletes this channel
Since
3.0.180Declaration
Swift
open func delete(completionHandler: SBErrorHandler?)Parameters
completionHandlerThe handler block to execute.
channelis the open channel instance which is deleted. -
Gets an open channel instance from channel URL.
Declaration
Swift
open class func getChannel( url: String, completionHandler: OpenChannelHandler? )Parameters
urlThe channel URL.
completionHandlerThe handler block to execute.
channelis the open channel instance which has thechannelURL. -
Refreshes the channel information.
Declaration
Swift
open func refresh(completionHandler: SBErrorHandler?)Parameters
completionHandlerThe handler block to execute.
-
Enters this channel.
Declaration
Swift
open func enter(completionHandler: SBErrorHandler?)Parameters
completionHandlerThe handler block to execute.
-
Exits this channel.
Declaration
Swift
open func exit(completionHandler: SBErrorHandler?)Parameters
completionHandlerThe handler block to execute.
-
Creates a query instance for open channel list.
Declaration
Swift
open class func createOpenChannelListQuery() -> OpenChannelListQueryReturn Value
The query instance for open channel list.
-
Creates a query instance for open channel list.
Declaration
Swift
open class func createOpenChannelListQuery(paramsBuilder: (OpenChannelListQueryParams) -> Void) -> OpenChannelListQueryParameters
paramsBuilderThe builder closure for setting
OpenChannelListQueryParams.Return Value
The query instance for open channel list.
-
Creates a query instance for open channel list.
Declaration
Swift
open class func createOpenChannelListQuery(params: OpenChannelListQueryParams) -> OpenChannelListQueryParameters
paramsThe params object to change query condition.
Return Value
The query instance for open channel list.
-
Creates a query instance for getting participant list of the channel with the given channel URL.
Declaration
Swift
open class func createParticipantListQuery(channelURL: String) -> ParticipantListQueryParameters
channelURLURL of the channel to create the query with.
Return Value
ParticipantListQuery instance for the participant list of the channel instance.
-
Creates a query instance for getting participant list of the channel with the given channel URL.
Declaration
Swift
open class func createParticipantListQuery(channelURL: String, paramsBuilder: (ParticipantListQueryParams) -> Void) -> ParticipantListQueryParameters
channelURLURL of the channel to create the query with.
paramsBuilderThe builder closure for setting
ParticipantListQueryParams.Return Value
ParticipantListQuery instance for the participant list of the channel instance.
-
Creates a query instance for getting participant list of the channel with the given channel URL.
Declaration
Swift
open class func createParticipantListQuery(channelURL: String, params: ParticipantListQueryParams) -> ParticipantListQueryParameters
channelURLURL of the channel to create the query with.
paramsThe params object to change query condition.
Return Value
ParticipantListQuery instance for the participant list of the channel instance.
-
Creates a participant list query for this channel.
Declaration
Swift
open func createParticipantListQuery() -> ParticipantListQuery?Return Value
UserListQueryinstance for the participant list of the channel instance. -
Creates a participant list query for this channel.
Declaration
Swift
open func createParticipantListQuery(paramsBuilder: (ParticipantListQueryParams) -> Void) -> ParticipantListQuery?Parameters
paramsBuilderThe builder closure for setting
ParticipantListQueryParams.Return Value
UserListQueryinstance for the participant list of the channel instance. -
Creates a participant list query for this channel.
Declaration
Swift
open func createParticipantListQuery(params: ParticipantListQueryParams) -> ParticipantListQuery?Parameters
paramsThe params object to change query condition.
Return Value
UserListQueryinstance for the participant list of the channel instance. -
Deserializes and reconstructs the object
Declaration
Swift
open override class func build(fromSerializedData data: Data?) -> Self?Parameters
dataDatainstanceReturn Value
OpenChannelif parameter is valid, otherwisenil
View on GitHub
Install in Dash