BaseChannelDelegate

@objc(SBDBaseChannelDelegate)
public protocol BaseChannelDelegate

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 the BaseChannelDelegate 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 BaseChannel was changed.
  • Receives an event when the BaseChannel was deleted.
  • Receives an event when a message in the BaseChannel was deleted.
  • Receives an event when meta data in the BaseChannel was changed.
  • Receives an event when meta counters in the BaseChannel were 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

    @objc(channel:didReceiveMessage:)
    optional func channel(_ channel: BaseChannel, didReceive message: BaseMessage)

    Parameters

    channel

    The channel where the message is received.

    message

    The received message.

  • A callback when a message is updated.

    Declaration

    Swift

    @objc(channel:didUpdateMessage:)
    optional func channel(_ channel: BaseChannel, didUpdate message: BaseMessage)

    Parameters

    channel

    The channel where the message is updated.

    message

    The updated message.

  • A delegate is called when someone mentioned the user.

    Declaration

    Swift

    @objc(channel:didReceiveMention:)
    optional func channel(_ channel: BaseChannel, didReceiveMention message: BaseMessage)

    Parameters

    channel

    The channel mention was occured in.

    message

    The message mention was occured about.

  • A callback when a user was muted in the channel.

    Declaration

    Swift

    @objc
    optional func channel(_ channel: BaseChannel, userWasMuted user: User)

    Parameters

    channel

    The channel.

    user

    The user who was muted.

  • A callback when a user was unmuted in the channel.

    Declaration

    Swift

    @objc
    optional func channel(_ channel: BaseChannel, userWasUnmuted user: User)

    Parameters

    channel

    The channel.

    user

    The user who was unmuted.

  • A callback when a user was banned in the channel.

    Declaration

    Swift

    @objc
    optional func channel(_ channel: BaseChannel, userWasBanned user: User)

    Parameters

    channel

    The channel.

    user

    The user who was banned.

  • A callback when a user was unbanned in the channel.

    Declaration

    Swift

    @objc
    optional func channel(_ channel: BaseChannel, userWasUnbanned user: User)

    Parameters

    channel

    The channel.

    user

    The user who was unbanned.

  • A callback when an channel was frozen.

    Declaration

    Swift

    @objc
    optional func channelWasFrozen(_ channel: BaseChannel)

    Parameters

    channel

    The channel.

  • A callback when an channel was unfrozen.

    Declaration

    Swift

    @objc
    optional func channelWasUnfrozen(_ channel: BaseChannel)

    Parameters

    channel

    The channel

  • A callback when an open channel was changed.

    Declaration

    Swift

    @objc
    optional func channelWasChanged(_ channel: BaseChannel)

    Parameters

    channel

    The open channel.

  • A callback when an open channel was deleted.

    Declaration

    Swift

    @objc
    optional func channelWasDeleted(_ channelURL: String, channelType: ChannelType)

    Parameters

    channelURL

    The channel url.

    channelType

    The Type of channel, types of open channel or group channel.

  • A callback when a message was removed in the channel.

    Declaration

    Swift

    @objc
    optional func channel(_ channel: BaseChannel, messageWasDeleted messageId: Int64)

    Parameters

    channel

    The base channel.

    messageId

    The message ID which was removed.

  • A callback when meta data was created in the channel.

    Declaration

    Swift

    @objc
    optional func channel(_ channel: BaseChannel, createdMetaData: [String : String]?)

    Parameters

    channel

    The channel that the meta data was created.

    createdMetaData

    The created meta data.

  • A callback when meta data was updated in the channel.

    Declaration

    Swift

    @objc
    optional func channel(_ channel: BaseChannel, updatedMetaData: [String : String]?)

    Parameters

    channel

    The channel that the meta data was updated.

    updatedMetaData

    The updated meta data.

  • A callback when meta data was deleted in the channel.

    Declaration

    Swift

    @objc
    optional func channel(_ channel: BaseChannel, deletedMetaDataKeys: [String]?)

    Parameters

    channel

    The channel that the meta data was deleted.

    deletedMetaDataKeys

    The keys of the deleted meta data.

  • A callback when meta counters were created in the channel.

    Declaration

    Swift

    @objc
    optional func channel(_ channel: BaseChannel, createdMetaCounters: [String : Int]?)

    Parameters

    channel

    The channel that the meta counters were created.

    createdMetaCounters

    The created meta counters.

  • A callback when meta counters were updated in the channel.

    Declaration

    Swift

    @objc
    optional func channel(_ channel: BaseChannel, updatedMetaCounters: [String : Int]?)

    Parameters

    channel

    The channel that the meta counters were updated.

    updatedMetaCounters

    The updated meta counters.

  • A callback when meta counters were deleted in the channel.

    Declaration

    Swift

    @objc
    optional func channel(_ channel: BaseChannel, deletedMetaCountersKeys: [String]?)

    Parameters

    channel

    The channel that the meta counters were deleted.

    deletedMetaCountersKeys

    The keys of the deleted meta counters.

  • A callback when a reaction was updated.

    Declaration

    Swift

    @objc
    optional func channel(_ channel: BaseChannel, updatedReaction reactionEvent: ReactionEvent)

    Parameters

    channel

    The channel that the reaction was updated.

    reactionEvent

    The updated reaction event.

  • A callback when operators were updated in the channel.

    Since

    3.0.174

    Declaration

    Swift

    @objc
    optional func channelDidUpdateOperators(_ channel: BaseChannel)

    Parameters

    channel

    The channel that the operators was updated.

  • Invoked when the thread information is updated.

    Since

    3.0.181

    Declaration

    Swift

    @objc
    optional func channel(_ channel: BaseChannel, didUpdateThreadInfo threadInfoUpdateEvent: ThreadInfoUpdateEvent)

    Parameters

    channel

    The channel that has the message thread.

    threadInfoUpdateEvent

    ThreadInfoUpdateEvent object that has the latest information about the thread.

  • A callback when the poll has been updated.

    Since

    3.0.232

    Declaration

    Swift

    @objc
    optional func didUpdatePoll(_ event: PollUpdateEvent)

    Parameters

    event

    event object contains updated poll information.

  • A callback when vote has been occurred.

    Since

    3.0.232

    Declaration

    Swift

    @objc
    optional func didVotePoll(_ event: PollVoteEvent)

    Parameters

    event

    event object that contains voting information.