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 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
chatroomA STSChat object informing the delegate about the failure of chatroom connection.
errorThe 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
chatroomA STSChat object informing the delegate about the error.
errorThe error object contains error detail.
-
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
chatroomA STSChat object informing the delegate about users joined.
usersNew 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
chatroomA STSChat object informing the delegate about users updated.
usersUpdated 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
chatroomA STSChat object informing the delegate about users left.
userLabelsUnique 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
chatroomA 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
chatroomA STSChat object informing the delegate about message added.
messageA STSChatMessage object with valid
textproperty. -
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
chatroomA STSChat object informing the delegate about message removed.
messageIdRemoved message object ID.
-
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
chatroomA STSChat object informing the delegate about the pinned message update.
messageThe 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
chatroomA STSChat object informing the delegate about the metadata updated.
updatedMetadataA 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
chatroomA STSChat object informing the delegate about aggregated items added.
aggregatedItemsAn 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
chatroomA STSChat object informing the delegate about raw data added.
rawDataA STSChatMessage object with valid
rawDataproperty from data channel.
View on GitHub
Install in Dash
STSChatEventDelegate Protocol Reference