GroupChannel

@objc(SBDGroupChannel)
open class GroupChannel : BaseChannel, SortableElement

The GroupChannel class represents a group channel which is a private chat.

The user who wants to join the group channel has to be invited by another user who is already joined the channel. This class is derived from BaseChannel. If the BaseChannelDelegate is added, the user will automatically receive all messages from the group channels where the user belongs after connection. The GroupChannel provides the features of general messaging apps.

  • Typing indicator.
  • Read status for each message.
  • Unread message count in the channel.
  • Lastest message in the channel.

The GroupChannel has a special property, isDistinct. The distinct property enabled group channel is always reuesd for same channel members. If a new member gets invited or the member left from the channel, then the distinct property disabled automatically. If you don’t set distinct property on the channel, it always create new channel for the same members.

For more information, see Group Channel.

  • Last message of the channel.

    Declaration

    Swift

    @objc
    open internal(set) var lastMessage: BaseMessage? { get }
  • Represents the channel is super channel or not.

    Declaration

    Swift

    @objc
    open internal(set) var isSuper: Bool { get }
  • Represents the channel is broadcast channel or not.

    Since

    3.0.171

    Declaration

    Swift

    @objc
    open internal(set) var isBroadcast: Bool { get }
  • Represents the channel is exclusive channel or not.

    Since

    4.0.0

    Declaration

    Swift

    @objc
    open internal(set) var isExclusive: Bool { get }
  • Represents the channel is public channel or private one.

    Declaration

    Swift

    @objc
    open internal(set) var isPublic: Bool { get }
  • Represents that the channel has access code to enter.

    Since

    3.0.116

    Declaration

    Swift

    @objc
    open internal(set) var isAccessCodeRequired: Bool { get }
  • Represents the channel is distinct or not.

    Declaration

    Swift

    @objc
    open internal(set) var isDistinct: Bool { get }
  • Represents a boolean whether the public group channel is discoverable. It is only for a public group channel. The default value is true if the channel is a public group channel. If the channel is not a public group channel, the default value is false.

    Since

    3.0.136

    Declaration

    Swift

    @objc
    open internal(set) var isDiscoverable: Bool { get }
  • Since

    4.6.0

    Declaration

    Swift

    @objc
    open internal(set) var isConversation: Bool { get }
  • Since

    4.6.0

    Declaration

    Swift

    @objc
    open internal(set) var isChatNotification: Bool { get }
  • Unread message count of the channel.

    Declaration

    Swift

    @Atomic
    @objc
    open internal(set) var unreadMessageCount: UInt { get set }
  • The number of mentions that user does not read yet in the channel.

    Since

    3.0.103

    Declaration

    Swift

    @objc
    open internal(set) var unreadMentionCount: UInt { get }
  • Channel members

    Note

    Number of member for Super GroupChannel is limited to 10

    Declaration

    Swift

    @objc
    open var members: [Member] { get }
  • The number of members.

    Declaration

    Swift

    @objc
    open internal(set) var memberCount: UInt { get }
  • The number of joined members.

    Declaration

    Swift

    @objc
    open internal(set) var joinedMemberCount: UInt { get }
  • Timestamp when current user joined

    Since

    3.0.224

    Declaration

    Swift

    @objc
    open internal(set) var joinedAt: Int64 { get }
  • Represents which push notification for the current user to receive in a group channel.

    Since

    3.0.128

    Declaration

    Swift

    @objc
    open internal(set) var myPushTriggerOption: GroupChannelPushTriggerOption { get }
  • Represents this channel is hidden or not.

    Declaration

    Swift

    @objc
    open internal(set) var isHidden: Bool { get }
  • Current member’s state in the channel.

    Declaration

    Swift

    @objc
    open internal(set) var myMemberState: MemberState { get }
  • The role of current user in the channel.

    Declaration

    Swift

    @objc
    open internal(set) var myRole: Role { get }
  • The muted state of the current user in the channel.

    Declaration

    Swift

    @objc
    open internal(set) var myMutedState: MutedState { get }
  • The preference lets to know counts in the channel. The default value is .all.

    Since

    3.0.102

    Declaration

    Swift

    @objc
    open internal(set) var myCountPreference: CountPreference { get }
  • The time stamp when the current user got a invitation from other user in the channel.

    Since

    3.0.107

    Declaration

    Swift

    @objc
    open internal(set) var invitedAt: Int64 { get }
  • The hidden state of the channel.

    Since

    3.0.122

    Declaration

    Swift

    @objc
    open internal(set) var hiddenState: GroupChannelHiddenState { get }
  • A last read information for the current user.

    Since

    3.0.138

    Declaration

    Swift

    @objc
    open internal(set) var myLastRead: Int64 { get }
  • Message offset of a channel. User can only see messages after this offset.

    Since

    3.0.157

    Declaration

    Swift

    @objc
    open var messageOffsetTimestamp: Int64 { get }
  • A value that sets the message survival time in seconds. In the channel that is created or updated with this option, the read messages are automatically deleted after a determined amount of time. The default value is -1 that represents the disappearing message is disabled.

    Note

    This feature is available in a 1-on-1 group channel.

    Since

    3.0.172

    Declaration

    Swift

    @objc
    open internal(set) var messageSurvivalSeconds: Int { get }
  • Indicates whether this channel includes any AI bots.

    Since

    4.20.0

    Declaration

    Swift

    @objc
    open internal(set) var hasAIBot: Bool { get }
  • Indicates whether this channel includes any bots.

    Since

    4.20.0

    Declaration

    Swift

    @objc
    open internal(set) var hasBot: Bool { get }
  • Checks if the channel has a member that has userId.

    Declaration

    Swift

    @objc
    open func hasMember(_ userId: String) -> Bool

    Parameters

    userId

    User ID.

    Return Value

    If true, the channel has the member.

  • Gets member in the channel.

    Declaration

    Swift

    @objc
    open func getMember(_ userId: String) -> Member?

    Parameters

    userId

    User ID.

    Return Value

    Member object as a member. If there is a member who has the userId, Returns nil.

  • Gets a user who invites current user to this channel

    Declaration

    Swift

    @objc
    open func getInviter() -> User?

    Return Value

    optional `User

  • Gets my delivery status in UTC timestamp

    Declaration

    Swift

    @objc
    open func myDeliveryStatus() -> Int64
  • Compares two channel objects with the channel list order.

    Since

    3.0.227

    Declaration

    Swift

    @objc
    open class func compare(
        channelA: GroupChannel,
        channelB: GroupChannel,
        order: GroupChannelListOrder
    ) -> Bool

    Parameters

    channelA

    First channel object.

    channelB

    Second channel obejct.

    order

    Order.

  • Default constructor.

    Declaration

    Swift

    public required init(from decoder: Decoder) throws

    Parameters

    decoder

    Decoder instance

  • Encodes this object.

    Declaration

    Swift

    public override func encode(to encoder: Encoder) throws

    Parameters

    encoder

    Encoder instance

  • Compares this object with given other object.

    Declaration

    Swift

    public override func isEqual(_ object: Any?) -> Bool

    Parameters

    object

    Any instance

    Return Value

    true if same otherwise false

  • Refreshes this channel instance.

    Declaration

    Swift

    @objc
    open func refresh(completionHandler: SBErrorHandler?)

    Parameters

    completionHandler

    The handler block to execute.

  • Creates a group channel with GroupChannelCreateParams class.

    Declaration

    Swift

    @objc(createChannelWithParams:completionHandler:)
    open class func createChannel(
        params: GroupChannelCreateParams,
        completionHandler: GroupChannelHandler?
    )

    Parameters

    params

    The parameter instance of GroupChannelCreateParams what has properties to create group channel.

    completionHandler

    The handler block to execute. channel is the group channel instance which has the userIds as members.

  • Creates a group channel with GroupChannelCreateParams class.

    Since

    3.0.215

    Declaration

    Swift

    @objc(createChannelWithParams:progressHandler:completionHandler:)
    open class func createChannel(
        params: GroupChannelCreateParams,
        progressHandler: ProgressHandler?,
        completionHandler: GroupChannelHandler?
    )

    Parameters

    params

    The parameter instance of GroupChannelCreateParams what has properties to create group channel.

    progressHandler

    The handler block to monitor progression. bytesSent is the number of bytes sent since the last time this method was called. totalBytesSent is the total number of bytes sent so far. totalBytesExpectedToSend is the expected length of the body data. These parameters are the same to the declaration of urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:).

    completionHandler

    The handler block to execute. channel is the group channel instance which has the userIds as members.

  • Creates a group channel with GroupChannelCreateParams class.

    The completionHandler Returns isCreated, which notifies the channel instance is created now.

    Since

    3.0.122

    Declaration

    Swift

    @objc(createDistinctChannelIfNotExistWithParams:completionHandler:)
    open class func createDistinctChannelIfNotExist(
        params: GroupChannelCreateParams,
        completionHandler: @escaping DistinctGroupChannelHandler
    )

    Parameters

    params

    The parameter instance of GroupChannelCreateParams what has properties to create group channel. The channel that is created by this method is always a distinct channel regardless of the isDistinct value of the params.

    completionHandler

    The handler block to be executed. If the channel instance is new, then isCreated is true.

  • Creates a group channel with GroupChannelCreateParams class.

    The completionHandler Returns isCreated, which notifies the channel instance is created now.

    Since

    3.0.215

    Declaration

    Swift

    @objc(createDistinctChannelIfNotExistWithParams:progressHandler:completionHandler:)
    open class func createDistinctChannelIfNotExist(
        params: GroupChannelCreateParams,
        progressHandler: ProgressHandler?,
        completionHandler: @escaping DistinctGroupChannelHandler
    )

    Parameters

    params

    The parameter instance of GroupChannelCreateParams what has properties to create group channel. The channel that is created by this method is always a distinct channel regardless of the isDistinct value of the params.

    progressHandler

    The handler block to monitor progression. bytesSent is the number of bytes sent since the last time this method was called. totalBytesSent is the total number of bytes sent so far. totalBytesExpectedToSend is the expected length of the body data. These parameters are the same to the declaration of urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:).

    completionHandler

    The handler block to be executed. If the channel instance is new, then isCreated is true.

Update Channel

  • Update a group channel with GroupChannelUpdateParams class.

    Declaration

    Swift

    @objc(updateChannelWithParams:completionHandler:)
    open func update(
        params: GroupChannelUpdateParams,
        completionHandler: @escaping GroupChannelHandler
    )

    Parameters

    params

    instance of GroupChannelUpdateParams contains what to update for group channel.

    completionHandler

    The handler block to execute. channel is the group channel instance which has the userIds as members.

  • Update a group channel with GroupChannelUpdateParams class.

    Since

    3.0.215

    Declaration

    Swift

    @objc(updateChannelWithParams:progressHandler:completionHandler:)
    open func update(
        params: GroupChannelUpdateParams,
        progressHandler: ProgressHandler?,
        completionHandler: @escaping GroupChannelHandler
    )

    Parameters

    params

    instance of GroupChannelUpdateParams contains what to update for group channel.

    progressHandler

    The handler block to monitor progression. bytesSent is the number of bytes sent since the last time this method was called. totalBytesSent is the total number of bytes sent so far. totalBytesExpectedToSend is the expected length of the body data. These parameters are the same to the declaration of urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:).

    completionHandler

    The handler block to execute. channel is the group channel instance which has the userIds as members.

  • Gets a group channel instance from channel URL asynchronously.

    Declaration

    Swift

    @objc(getChannelWithURL:completionHandler:)
    open class func getChannel(url: String, completionHandler: GroupChannelHandler?)

    Parameters

    url

    The channel URL.

    completionHandler

    The handler block to execute. channel is the group channel instance which has the channelURL.

  • Deletes the group channel. The user has to be an operator of the channel.

    Since

    3.0.137

    Declaration

    Swift

    @objc(deleteChannelWithCompletionHandler:)
    open func delete(completionHandler: SBErrorHandler?)

    Parameters

    completionHandler

    The handler block to execute.

  • Resets the history in this channel.

    Declaration

    Swift

    open func resetMyHistory(completionHandler: SBErrorHandler?)

    Parameters

    completionHandler

    The handler block to execute.

  • Changes a setting that decides which push notification for the current user to receive in the group channel.

    If a value of option is .default, a push trigger option in this group channel follows a push trigger option of the current user. It is related with SendbirdChat setPushTriggerOption(_:completionHandler:).

    Since

    3.0.128

    Declaration

    Swift

    open func setMyPushTriggerOption(
        _ option: GroupChannelPushTriggerOption,
        completionHandler: SBErrorHandler?
    )

    Parameters

    option

    options to choose which push notification for the current user to receive.

    completionHandler

    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 the group channel.

    Since

    3.0.128

    Declaration

    Swift

    open func getMyPushTriggerOption(completionHandler: @escaping GroupChannelPushTriggerOptionHandler)

    Parameters

    completionHandler

    The handler block to execute when getting a push trigger option of the current user is completed.

  • Sets count preference of current user.

    Since

    3.0.102

    Declaration

    Swift

    open func setMyCountPreference(
        _ myCountPreference: CountPreference,
        completionHandler: SBErrorHandler?
    )

    Parameters

    myCountPreference

    Preference is type of CountPreference. The default value is .all.

  • Returns the delivery status as objects.

    [{USER_ID}: DeliveryStatus]
    

    USER_ID is the user ID as a key. Each USER_ID has a Dictionary which includes Member object and Int64. The “user” is a key of Member object and the “timestamp” is a key of Int64 object.

    Since

    4.12.2

    Declaration

    Swift

    @nonobjc
    public func getDeliveryStatus(with includeAllMembers: Bool) -> [String : DeliveryStatus]

    Parameters

    includeAllMembers

    If true, the return value includes the current user and the sender of the message.

    Return Value

    The delivery status. If there is no data, it will not be added to the dictionary.

  • Freeze the channel. If channel is frozen, only operators can send messages to the channel.

    Since

    3.0.89

    Declaration

    Swift

    open func freeze(completionHandler: SBErrorHandler?)

    Parameters

    completionHandler

    The handler block to be executed after freeze.

  • Stop to freeze the channel. If It is not frozen channel, this will be ignored.

    Since

    3.0.89

    Declaration

    Swift

    open func unfreeze(completionHandler: SBErrorHandler?)

    Parameters

    completionHandler

    The handler block to be executed after stop to freeze.

Send

  • Sends a multipleFilesMessage with files (file or file URL) of params.

    For binary files in params.files, the data will be uploaded to Sendbird storage. For URL files in params.files, the URLs will be sent in the message.

    Declaration

    Swift

    @discardableResult
    @objc
    public func sendMultipleFilesMessage(
        params: MultipleFilesMessageCreateParams,
        fileUploadHandler: FileUploadHandler?,
        completionHandler: @escaping MultipleFilesMessageHandler
    ) -> MultipleFilesMessage?

    Parameters

    params

    An intance of MultipleFilesMessageCreateParams that contains parameters needed to create a MultipleFilesMessage.

    fileUploadHandler

    A handler block to be executed after each file is uploaded. This block has no return value, and takes four arguments: first is requestId of a file, second is the index of a file, third is the UploadableFileInfo, and the fourth is the error made when there is a problem in uploading the file. This handler is called for both file-based UploadableFileInfo and file URL-based UploadableFileInfo.

    completionHandler

    A handler block to be executed after the message is sent. This block has no return value, and takes two arguments: one is a multipleFilesMessage that is sent, and the other is an error made when there is a problem in sending the message.

    Return Value

    A temporary multipleFilesMessage being sent to the Sendbird server. The sending status of the message is pending. The message has a request ID instead of a message ID.

Copy

Resend

  • Attempts to resend a failed mutiple files message.

    Note

    Only resends the message that its sendingStatus is failed

    Since

    4.10.0

    Declaration

    Swift

    @discardableResult
    @objc(resendMultipleFilesMessageWithMessage:fileUploadHandler:completionHandler:)
    public func resendMultipleFilesMessage(
        _ message: MultipleFilesMessage,
        fileUploadHandler: FileUploadHandler?,
        completionHandler: MultipleFilesMessageHandler?
    ) -> MultipleFilesMessage?

    Parameters

    message

    MultipleFilesMessage object to resend.

    fileUploadHandler

    A handler block to execute after each file is uploaded. This block takes four arguments: the requestId of a file, the index of a file, UploadableFileInfo object, and the error

    completionHandler

    The handler block to excute when the sending is completed. When the sending is failed, the parameter represents the failed message.

    completionHandler

    The handler block to excute when the sending is completed. When the sending is failed, the parameter represents the failed message.

    Return Value

    A temporary MultipleFilesMessage object being sent to the Sendbird server.

  • Invites a single user to the group channel.

    Declaration

    Swift

    open func inviteUser(_ user: User, completionHandler: SBErrorHandler?)

    Parameters

    user

    The user to be invited.

    completionHandler

    The handler block to execute.

  • Invites a single user to the group channel.

    Declaration

    Swift

    open func inviteUserId(_ userId: String, completionHandler: SBErrorHandler?)

    Parameters

    userId

    The user ID to be invited.

    completionHandler

    The handler block to execute.

  • Invites multiple users to the group channel.

    Declaration

    Swift

    open func inviteUsers(_ users: [User], completionHandler: SBErrorHandler?)

    Parameters

    users

    The user array to be invited.

    completionHandler

    The handler block to execute.

  • Invites multiple users to the group channel.

    Declaration

    Swift

    open func inviteUserIds(_ userIds: [String], completionHandler: SBErrorHandler?)

    Parameters

    userIds

    The IDs of users array to be invited.

    completionHandler

    The handler block to execute.

  • Accpets the invitation.

    Declaration

    Swift

    open func acceptInvitation(completionHandler: SBErrorHandler?)

    Parameters

    completionHandler

    The handler block to execute.

  • Accpets the invitation from a public group channel that has access code.

    Since

    3.0.116

    Declaration

    Swift

    open func acceptInvitation(accessCode: String?, completionHandler: SBErrorHandler?)

    Parameters

    accessCode

    The string code is used to accept invitation from a public group channel.

    completionHandler

    The handler block to be executed after accepting. This block has no return value and takes an argument that is an error made when there is something wrong to accept.

  • Declines the invitation.

    Declaration

    Swift

    open func declineInvitation(completionHandler: SBErrorHandler?)

    Parameters

    completionHandler

    The handler block to execute.

  • Join a group channel

    Declaration

    Swift

    open func join(completionHandler: SBErrorHandler?)

    Parameters

    completionHandler

    The handler block to execute.

  • Join a public group channel that has access code.

    Since

    3.0.116

    Declaration

    Swift

    open func join(accessCode: String?, completionHandler: SBErrorHandler?)

    Parameters

    accessCode

    The string code is used to join a public group channel.

    completionHandler

    The handler block to be executed after joining. This block has no return value and takes an argument that is an error made when there is something wrong to join.

  • Leaves the group channel. The channel will be disappeared from the channel list. If join the channel, the invitation is required.

    Declaration

    Swift

    @objc(leaveChannelWithCompletionHandler:)
    open func leave(completionHandler: SBErrorHandler?)

    Parameters

    completionHandler

    The handler block to execute.

  • Leaves the group channel. The channel will be disappeared from the channel list. If join the channel, the invitation is required.

    Since

    4.0.9

    Declaration

    Swift

    @objc(leaveChannelWithShouldRemoveOperatorStatus:completionHandler:)
    open func leave(shouldRemoveOperatorStatus: Bool, completionHandler: SBErrorHandler?)

    Parameters

    shouldRemoveOperatorStatus

    Set to true if you want the operator to remove the state when they leaves. Default is false

    completionHandler

    The handler block to execute.

  • Hides the group channel. The channel will be hid from the channel list, but it will be appeared again when the other user send a message in the channel.

    Declaration

    Swift

    @objc(hideChannelWithHidePreviousMessages:completionHandler:)
    open func hide(
        hidePreviousMessages: Bool,
        completionHandler: SBErrorHandler?
    )

    Parameters

    hidePreviousMessages

    The option to hide the previous message of this channel when the channel will be appeared again.

    completionHandler

    The handler block to execute.

  • Hides the group channel with the auto unhide option. The channel will be hid from the channel list. If the allowAutoUnhide is true, the channel will be appeared again when the other user send a message in the channel. However, if the allowAutoUnhide is false, the channel will be appeared by unhideChannel(completionHandler:) method.

    Since

    3.0.122

    Declaration

    Swift

    @objc(hideChannelWithHidePreviousMessages:allowAutoUnhide:completionHandler:)
    open func hide(
        hidePreviousMessages: Bool,
        allowAutoUnhide: Bool,
        completionHandler: SBErrorHandler?
    )

    Parameters

    hidePreviousMessages

    The option to hide the previous message of this channel when the channel will be appeared again.

    allowAutoUnhide

    The auto unhide option.

    completionHandler

    THe handle block to be executed.

  • Unhides the group channel.

    Since

    3.0.122

    Declaration

    Swift

    @objc(unhideChannelWithCompletionHandler:)
    open func unhide(completionHandler: SBErrorHandler?)

    Parameters

    completionHandler

    THe handle block to be executed.

  • Sends mark as read. The other members in the channel will receive an event. The event will be received in channelDidUpdateReadStatus: of GroupChannelDelegate.

    Declaration

    Swift

    @objc(markAsReadWithCompletionHandler:)
    open func markAsRead(completionHandler: SBErrorHandler?)

    Parameters

    completionHandler

    completion handler

  • Notifies the current user took a screenshot in this channel. The server is going to send an admin message to notify this in the group channel.

    Since

    3.0.172

    Declaration

    Swift

    open func notifyScreenshotWasTaken(completionHandler: SBErrorHandler?)

    Parameters

    completionHandler

    The handler block to be executed.

  • Creates a query for my group channel list with default params.

    Declaration

    Swift

    @objc
    open class func createMyGroupChannelListQuery() -> GroupChannelListQuery

    Return Value

    GroupChannelListQuery instance for the current user.

  • Creates a query for my group channel list with paramsBuilder.

    Declaration

    Swift

    @objc
    open class func createMyGroupChannelListQuery(paramsBuilder: (GroupChannelListQueryParams) -> Void) -> GroupChannelListQuery

    Parameters

    paramsBuilder

    The builder closure for setting GroupChannelListQueryParams.

    Return Value

    GroupChannelListQuery instance for the current user.

  • Creates a query for my group channel list.

    Declaration

    Swift

    @objc
    open class func createMyGroupChannelListQuery(params: GroupChannelListQueryParams) -> GroupChannelListQuery

    Parameters

    params

    Return Value

    GroupChannelListQuery instance for the current user.

  • Creates a query for public group channel list.

    Declaration

    Swift

    @objc
    open class func createPublicGroupChannelListQuery() -> PublicGroupChannelListQuery

    Return Value

    The instance to query public group channels.

  • Creates a query for public group channel list.

    Declaration

    Swift

    @objc
    open class func createPublicGroupChannelListQuery(paramsBuilder: (PublicGroupChannelListQueryParams) -> Void) -> PublicGroupChannelListQuery

    Parameters

    paramsBuilder

    The builder closure for setting PublicGroupChannelListQueryParams.

    Return Value

    The instance to query public group channels.

  • Creates a query for public group channel list.

    Declaration

    Swift

    @objc
    open class func createPublicGroupChannelListQuery(params: PublicGroupChannelListQueryParams) -> PublicGroupChannelListQuery

    Parameters

    params

    The params object to change query condition.

    Return Value

    The instance to query public group channels.

  • Creates a query for members in group channel.

    Declaration

    Swift

    @objc
    open class func createMemberListQuery(channelURL: String) -> MemberListQuery

    Parameters

    channelURL

    channel url

    Return Value

    The instance to query the members in group channel.

  • Creates a query for members in group channel.

    Declaration

    Swift

    @objc
    open class func createMemberListQuery(channelURL: String, paramsBuilder: (MemberListQueryParams) -> Void) -> MemberListQuery

    Parameters

    channelURL

    channel url

    paramsBuilder

    The builder closure for setting MemberListQueryParams.

    Return Value

    The instance to query the members in group channel.

  • Creates a query for members in group channel.

    Declaration

    Swift

    @objc
    open func createMemberListQuery() -> MemberListQuery?

    Return Value

    The instance to query the members in group channel.

  • Creates a query for members in group channel.

    Declaration

    Swift

    @objc
    open func createMemberListQuery(paramsBuilder: (MemberListQueryParams) -> Void) -> MemberListQuery?

    Parameters

    paramsBuilder

    The builder closure for setting MemberListQueryParams.

    Return Value

    The instance to query the members in group channel.

  • Creates a query for members in group channel.

    Declaration

    Swift

    @objc
    open func createMemberListQuery(params: MemberListQueryParams) -> MemberListQuery?

    Parameters

    params

    The params object to change query condition.

    Return Value

    The instance to query the members in group channel.

  • Returns how many members haven’t been read the given message yet.

    Since

    3.0.185

    Declaration

    Swift

    open func getUnreadMemberCount(_ message: BaseMessage) -> Int

    Parameters

    message

    The message.

    Return Value

    Number of unread member count. Zero if all members read the message.

  • Returns the members who read the given message.

    Since

    3.0.115

    Declaration

    Swift

    @objc(getReadMembersWithMessage:includeAllMembers:)
    open func getReadMembers(
        message: BaseMessage,
        includeAllMembers: Bool
    ) -> [Member]

    Parameters

    message

    The message.

    includeAllMembers

    If true, the return value includes the current user and the sender of the message.

    Return Value

    Members who read the message.

  • Returns the members who didn’t read the given message.

    Since

    3.0.115

    Declaration

    Swift

    @objc(getUnreadMembersWithMessage:includeAllMembers:)
    open func getUnreadMembers(
        message: BaseMessage,
        includeAllMembers: Bool
    ) -> [Member]

    Parameters

    message

    The message.

    includeAllMembers

    If true, the return value includes the current user and the sender of the message.

    Return Value

    Members who don’t read the message.

  • Returns how many members haven’t been delivery the given message yet.

    Since

    3.0.185

    Declaration

    Swift

    open func getUndeliveredMemberCount(_ message: BaseMessage) -> Int

    Parameters

    message

    The message.

    Return Value

    Number of undelivered member count. Zero if all members delivered the message.

  • Returns the read status.

    Since

    3.0.115

    [ USER_ID: [ “user”: User object, “last_seen_at”: Int64, ] ]

    USER_ID is the user ID as a key. Each USER_ID has a Dictionary which includes User object and Int64. The “user” is a key of User object and the “last_seen_at” is a key of Int64 object.

    Declaration

    Swift

    @objc(getReadStatusIncludingAllMembers:)
    open func getReadStatus(includeAllMembers: Bool) -> [String : [String : Any]]

    Parameters

    includeAllMembers

    If true, the return value includes the current user and the sender of the message.

    Return Value

    The read status. If there’s no data, it will be an empty dictionary.

  • Returns the read status as objects.

    [{USER_ID}: ReadStatus]
    

    USER_ID is the user ID as a key. Each USER_ID has a Dictionary which includes User object and Int64. The “user” is a key of User object and the “last_seen_at” is a key of Int64 object.

    Since

    4.12.2

    Declaration

    Swift

    @nonobjc
    public func getReadStatus(with includeAllMembers: Bool) -> [String : ReadStatus]

    Parameters

    includeAllMembers

    If true, the return value includes the current user and the sender of the message.

    Return Value

    The read status. If there is no data, it will not be added to the dictionary.

  • Creates a file message to be sent at the specified time.

    Note

    If a user leaves before sending scheduled messages, the scheduled messages will be removed.

    Since

    4.0.0

    Declaration

    Swift

    @discardableResult
    @objc(createScheduledFileMessageWithParams:completionHandler:)
    open func createScheduledFileMessage(
        params: ScheduledFileMessageCreateParams,
        completionHandler: FileMessageHandler?
    ) -> FileMessage?

    Parameters

    params

    The instance of ScheduledFileMessageCreateParams that can has parameters related with file message.

    completionHandler

    The handler block to be executed after the message is registered in the schedule. This block has no return value and takes two argument, one is a user message is registered in the schedule and other is an error made when there is something wrong to message.

  • Updates a scheduled file message.

    Note

    If a user leaves before sending scheduled messages, the scheduled messages will be removed.

    Since

    4.0.0

    Declaration

    Swift

    @objc(updateScheduledFileMessageWithScheduledMessageId:params:completionHandler:)
    open func updateScheduledFileMessage(
        scheduledMessageId: Int64,
        params: ScheduledFileMessageUpdateParams,
        completionHandler: FileMessageHandler?
    )

    Parameters

    scheduledMessageId

    The scheduled message ID.

    params

    The instance of ScheduledFileMessageUpdateParams that can has parameters related with file message.

    completionHandler

    The handler block to be executed after the message is registered in the schedule. This block has no return value and takes two argument, one is a user message is registered in the schedule and other is an error made when there is something wrong to message.

  • Sends the scheduled message now.

    Since

    4.0.0

    Declaration

    Swift

    @objc
    open func sendScheduledMessageNow(
        scheduledMessageId: Int64,
        completionHandler: @escaping SBErrorHandler
    )

    Parameters

    scheduledMessageId

    The scheduled message ID.

    completionHandler

    The handler block to be executed after sending the scheduled message or when an error occurs.

  • Cancels the scheduled message.

    Since

    4.0.0

    Declaration

    Swift

    @objc
    open func cancelScheduledMessage(
        scheduledMessageId: Int64,
        completionHandler: @escaping SBErrorHandler
    )

    Parameters

    scheduledMessageId

    The scheduled message ID.

    completionHandler

    The handler block to be executed after canceling the scheduled message or when an error occurs.

  • Creates a user message to be sent at the specified time.

    Note

    If a user leaves before sending scheduled messages, the scheduled messages will be removed.

    Since

    4.0.2

    Declaration

    Swift

    @discardableResult
    @objc(createScheduledUserMessageWithParams:completionHandler:)
    open func createScheduledUserMessage(
        params: ScheduledUserMessageCreateParams,
        completionHandler: UserMessageHandler?
    ) -> UserMessage?

    Parameters

    params

    The instance of ScheduledUserMessageCreateParams that can has parameters related with string message.

    completionHandler

    The handler block to be executed after the message is registered in the schedule. This block has no return value and takes two argument, one is a user message is registered in the schedule and other is an error made when there is something wrong to message.

  • Updates a user message to be sent at the specified time.

    Note

    If a user leaves before sending scheduled messages, the scheduled messages will be removed.

    Since

    4.0.0

    Declaration

    Swift

    @objc(updateScheduledUserMessageWithScheduledMessageId:userMessageParams:completionHandler:)
    open func updateScheduledUserMessage(
        scheduledMessageId: Int64,
        params: ScheduledUserMessageUpdateParams,
        completionHandler: UserMessageHandler?
    )

    Parameters

    scheduledMessageId

    The scheduled message ID.

    params

    The instance of ScheduledUserMessageUpdateParams that can has parameters related with string message.

    completionHandler

    The handler block to be executed after the message is registered in the schedule. This block has no return value and takes two argument, one is a user message is registered in the schedule and other is an error made when there is something wrong to message.

  • Starts typing. The other members in the channel will receive an event.

    The event will be received in channelDidUpdateTypingStatus(_:) of GroupChannelDelegate.

    Declaration

    Swift

    open func startTyping()
  • Ends typing. The other members in the channel will receive an event.

    The event will be received in channelDidUpdateTypingStatus(_:) of GroupChannelDelegate.

    Declaration

    Swift

    open func endTyping()
  • Checks any members in the channel has been typing

    Declaration

    Swift

    open func isTyping() -> Bool

    Return Value

    true when other users are typing in this channel.

  • Returns the users who are typing now.

    Since

    3.0.202

    Declaration

    Swift

    open func getTypingUsers() -> [User]?

    Return Value

    The users who are typing now.

  • Deserializes and reconstructs the object

    Declaration

    Swift

    open override class func build(fromSerializedData data: Data?) -> `Self`?

    Parameters

    data

    Data instance

    Return Value

    GroupChannel if parameter is valid, otherwise nil