BaseChannelDelegate
public protocol BaseChannelDelegate: AnyObject
An object that adopts the BaseChannelDelegate protocol is responsible for receiving the events
in the channel. Delegate methods in BaseChannelDelegate are common for the BaseChannel.
Exclusive delegate methods for OpenChannel and GroupChannel can be found in
OpenChannelDelegate and GroupChannelDelegate. You must use OpenChannelDelegate
and GroupChannelDelegate instead of using BaseChannelDelegate by using add(_:identifier:) in SendbirdChat.
Warning
If the object that adopts theBaseChannelDelegate protocol is invalid, the delegate has to
be removed by the identifier via removeChannelDelegate(forIdentifier:) in SendbirdChat.
This protocol deals with the below events.
- Receives a message in the
BaseChannel. - Receives an event when a message is updated in the
BaseChannel. - Receives an event when the property of the
BaseChannelwas changed. - Receives an event when the
BaseChannelwas deleted. - Receives an event when a message in the
BaseChannelwas deleted. - Receives an event when meta data in the
BaseChannelwas changed. - Receives an event when meta counters in the
BaseChannelwere changed. - Receives an event when a group channel was hidden.
- Receives an event when a user was muted or unmuted in the
BaseChannel. - Receives an event when a user was banned or unbanned in the
BaseChannel. - Receives an event when operators are updated.
- Receives an event when a reaction of message in a channel was updated.
-
A callback when a message is received.
Declaration
Swift
func channel(_ channel: BaseChannel, didReceive message: BaseMessage)Parameters
channelThe channel where the message is received.
messageThe received message.
-
A callback when a message is updated.
Declaration
Swift
func channel(_ channel: BaseChannel, didUpdate message: BaseMessage)Parameters
channelThe channel where the message is updated.
messageThe updated message.
-
A delegate is called when someone mentioned the user.
Declaration
Swift
func channel(_ channel: BaseChannel, didReceiveMention message: BaseMessage)Parameters
channelThe channel mention was occured in.
messageThe message mention was occured about.
-
A callback when a user was muted in the channel.
Declaration
Swift
optional func channel(_ channel: BaseChannel, userWasMuted user: RestrictedUser)Parameters
channelThe channel.
userThe user who was muted.
-
A callback when a user was unmuted in the channel.
Declaration
Swift
optional func channel(_ channel: BaseChannel, userWasUnmuted user: User)Parameters
channelThe channel.
userThe user who was unmuted.
-
A callback when a user was banned in the channel.
Declaration
Swift
optional func channel(_ channel: BaseChannel, userWasBanned user: RestrictedUser)Parameters
channelThe channel.
userThe user who was banned.
-
A callback when a user was unbanned in the channel.
Declaration
Swift
optional func channel(_ channel: BaseChannel, userWasUnbanned user: User)Parameters
channelThe channel.
userThe user who was unbanned.
-
A callback when a channel was frozen.
Declaration
Swift
optional func channelWasFrozen(_ channel: BaseChannel)Parameters
channelThe channel.
-
A callback when an channel was unfrozen.
Declaration
Swift
optional func channelWasUnfrozen(_ channel: BaseChannel)Parameters
channelThe channel
-
A callback for when channel property is changed.
Declaration
Swift
optional func channelWasChanged(_ channel: BaseChannel)Parameters
channelThe channel the property is changed of.
-
A callback for when a channel was deleted.
Declaration
Swift
optional func channelWasDeleted(_ channelURL: String, channelType: ChannelType)Parameters
channelURLThe channel url.
channelTypeThe type of channel that is deleted.
-
A callback when a message was removed in the channel.
Declaration
Swift
optional func channel(_ channel: BaseChannel, messageWasDeleted messageId: Int64)Parameters
channelThe base channel.
messageIdThe message ID which was removed.
-
A callback when meta data was created in the channel.
Declaration
Swift
optional func channel(_ channel: BaseChannel, createdMetaData: [String: String]?)Parameters
channelThe channel that the meta data was created.
createdMetaDataThe created meta data.
-
A callback when meta data was updated in the channel.
Declaration
Swift
optional func channel(_ channel: BaseChannel, updatedMetaData: [String: String]?)Parameters
channelThe channel that the meta data was updated.
updatedMetaDataThe updated meta data.
-
A callback when meta data was deleted in the channel.
Declaration
Swift
optional func channel(_ channel: BaseChannel, deletedMetaDataKeys: [String]?)Parameters
channelThe channel that the meta data was deleted.
deletedMetaDataKeysThe keys of the deleted meta data.
-
A callback when meta counters were created in the channel.
Declaration
Swift
optional func channel(_ channel: BaseChannel, createdMetaCounters: [String: Int]?)Parameters
channelThe channel that the meta counters were created.
createdMetaCountersThe created meta counters.
-
A callback when meta counters were updated in the channel.
Declaration
Swift
optional func channel(_ channel: BaseChannel, updatedMetaCounters: [String: Int]?)Parameters
channelThe channel that the meta counters were updated.
updatedMetaCountersThe updated meta counters.
-
A callback when meta counters were deleted in the channel.
Declaration
Swift
optional func channel(_ channel: BaseChannel, deletedMetaCountersKeys: [String]?)Parameters
channelThe channel that the meta counters were deleted.
deletedMetaCountersKeysThe keys of the deleted meta counters.
-
A callback when a reaction was updated.
Declaration
Swift
optional func channel(_ channel: BaseChannel, updatedReaction reactionEvent: ReactionEvent)Parameters
channelThe channel that the reaction was updated.
reactionEventThe updated reaction event.
-
A callback when operators were updated in the channel.
Since
3.0.174Declaration
Swift
optional func channelDidUpdateOperators(_ channel: BaseChannel)Parameters
channelThe channel that the operators was updated.
-
Invoked when the thread information is updated.
Since
3.0.181Declaration
Swift
optional func channel(_ channel: BaseChannel, didUpdateThreadInfo threadInfoUpdateEvent: ThreadInfoUpdateEvent)Parameters
channelThe channel that has the message thread.
threadInfoUpdateEventThreadInfoUpdateEventobject that has the latest information about the thread.
View on GitHub
Install in Dash