STSChatEventDelegate

@protocol STSChatEventDelegate <NSObject>

Chat room event delegate for notify chat connection event, mode change event, user event, or message event. Allow to handle chat room events in real time.

  • Chat room connected.

    Declaration

    Objective-C

    - (void)chatroomConnected:(nonnull STSChat *)chatroom;

    Swift

    optional func chatroomConnected(_ chatroom: STSChat)

    Parameters

    chatroom

    A STSChat object informing the delegate about the connection of chatroom.

  • Chat room disconnected.

    Declaration

    Objective-C

    - (void)chatroomDisconnected:(nonnull STSChat *)chatroom;

    Swift

    optional func chatroomDisconnected(_ chatroom: STSChat)

    Parameters

    chatroom

    A STSChat object informing the delegate about the disconnection.

  • Chat room fail to connect.

    Declaration

    Objective-C

    - (void)chatroom:(nonnull STSChat *)chatroom
        failToConnect:(nonnull NSError *)error;

    Swift

    optional func chatroom(_ chatroom: STSChat, failToConnect error: Error)

    Parameters

    chatroom

    A STSChat object informing the delegate about the failure of chatroom connection.

    error

    The error object contains detail info.

  • Error happened for chat room.

    Declaration

    Objective-C

    - (void)chatroom:(nonnull STSChat *)chatroom error:(nonnull NSError *)error;

    Swift

    optional func chatroom(_ chatroom: STSChat, error: Error)

    Parameters

    chatroom

    A STSChat object informing the delegate about the error.

    error

    The error object contains error detail.

  • Chat room input mode changed.

    Declaration

    Objective-C

    - (void)chatroomInputModeChanged:(nonnull STSChat *)chatroom;

    Swift

    optional func chatroomInputModeChanged(_ chatroom: STSChat)

    Parameters

    chatroom

    A STSChat object informing the delegate about the mode changed.

  • Users joined to chat room.

    Declaration

    Objective-C

    - (void)chatroom:(nonnull STSChat *)chatroom
         usersJoined:(nonnull NSArray<STSChatUser *> *)users;

    Swift

    optional func chatroom(_ chatroom: STSChat, usersJoined users: [STSChatUser])

    Parameters

    chatroom

    A STSChat object informing the delegate about users joined.

    users

    New user objects.

  • Users info updated for chat room.

    Declaration

    Objective-C

    - (void)chatroom:(nonnull STSChat *)chatroom
        usersUpdated:(nonnull NSArray<STSChatUser *> *)users;

    Swift

    optional func chatroom(_ chatroom: STSChat, usersUpdated users: [STSChatUser])

    Parameters

    chatroom

    A STSChat object informing the delegate about users updated.

    users

    Updated user objects

  • Users left from chat room.

    Declaration

    Objective-C

    - (void)chatroom:(nonnull STSChat *)chatroom
           usersLeft:(nonnull NSArray<NSNumber *> *)userLabels;

    Swift

    optional func chatroom(_ chatroom: STSChat, usersLeft userLabels: [NSNumber])

    Parameters

    chatroom

    A STSChat object informing the delegate about users left.

    userLabels

    Unique identifier of left users.

  • User count updated for chat room. Please check the chat object for new user count.

    Declaration

    Objective-C

    - (void)chatroomUserCount:(nonnull STSChat *)chatroom;

    Swift

    optional func chatroomUserCount(_ chatroom: STSChat)

    Parameters

    chatroom

    A STSChat object informing the delegate about users count changed.

  • Message was added to chat room.

    Declaration

    Objective-C

    - (void)chatroom:(nonnull STSChat *)chatroom
        messageAdded:(nonnull STSChatMessage *)message;

    Swift

    optional func chatroom(_ chatroom: STSChat, messageAdded message: STSChatMessage)

    Parameters

    chatroom

    A STSChat object informing the delegate about message added.

    message

    A STSChatMessage object with valid text property.

  • Message was removed from chat room.

    Declaration

    Objective-C

    - (void)chatroom:(nonnull STSChat *)chatroom
        messageRemoved:(nonnull NSString *)messageId;

    Swift

    optional func chatroom(_ chatroom: STSChat, messageRemoved messageId: String)

    Parameters

    chatroom

    A STSChat object informing the delegate about message removed.

    messageId

    Removed message object ID.

  • All message in chat room was flushed for chat room.

    Declaration

    Objective-C

    - (void)chatroomMessageFlushed:(nonnull STSChat *)chatroom;

    Swift

    optional func chatroomMessageFlushed(_ chatroom: STSChat)

    Parameters

    chatroom

    A STSChat object informing the delegate about message flushed.

  • The pinned message of the specific chatroom updated.

    Declaration

    Objective-C

    - (void)chatroom:(nonnull STSChat *)chatroom
        pinnedMessageUpdated:(STSChatMessage *_Nullable)pinnedMessage;

    Swift

    optional func chatroom(_ chatroom: STSChat, pinnedMessageUpdated pinnedMessage: STSChatMessage?)

    Parameters

    chatroom

    A STSChat object informing the delegate about the pinned message update.

    message

    The updated pinned message.

  • The metadata of the specific chatroom updated.

    Declaration

    Objective-C

    - (void)chatroom:(nonnull STSChat *)chatroom
        metadataUpdated:
            (nonnull NSDictionary<NSString *, STSChatMetadata *> *)updatedMetadata;

    Swift

    optional func chatroom(_ chatroom: STSChat, metadataUpdated updatedMetadata: [String : STSChatMetadata])

    Parameters

    chatroom

    A STSChat object informing the delegate about the metadata updated.

    updatedMetadata

    A dictionary of the updated metadata. The keys of the dictionary are the keys of those updated metadata.

  • Tells the delegate that an array of aggregated items has been added to data channel.

    Declaration

    Objective-C

    - (void)chatroom:(nonnull STSChat *)chatroom
        aggregatedItemsAdded:
            (nonnull NSArray<STSAggregatedItem *> *)aggregatedItems;

    Swift

    optional func chatroom(_ chatroom: STSChat, aggregatedItemsAdded aggregatedItems: [STSAggregatedItem])

    Parameters

    chatroom

    A STSChat object informing the delegate about aggregated items added.

    aggregatedItems

    An array of STSAggregatedItem objects.

  • Tells the delegate that a raw data has been added to data channel.

    Declaration

    Objective-C

    - (void)chatroom:(nonnull STSChat *)chatroom
        rawDataAdded:(nonnull STSChatMessage *)rawData;

    Swift

    optional func chatroom(_ chatroom: STSChat, rawDataAdded rawData: STSChatMessage)

    Parameters

    chatroom

    A STSChat object informing the delegate about raw data added.

    rawData

    A STSChatMessage object with valid rawData property from data channel.