SBDBaseChannel Class Reference

Inherits from NSObject
Declared in SBDBaseChannel.h

Overview

The SBDBaseChannel class represents the channel where users chat each other. The SBDOpenChannel and the SBDGroupChannel are derived from this class. This class provides the common methods for the SBDOpenChannel and the SBDGroupChannel.

  • Send a user message to the channel.
  • Send a file message to the channel.
  • Delete a message of the channel.
  • Create a query for loading messages of the channel.
  • Manipulate meta counters and meta data of the channel.

The channel objects are maintained as a single instance in an application. If you create or get channels from the same channel URL, they must be the same instances.

  channelUrl

The channel URL.

@property (strong, nonatomic, nonnull) NSString *channelUrl

Declared In

SBDBaseChannel.h

  name

The name of channel.

@property (strong, nonatomic, nonnull) NSString *name

Declared In

SBDBaseChannel.h

  coverUrl

The channel cover image URL.

@property (strong, nonatomic, nullable) NSString *coverUrl

Declared In

SBDBaseChannel.h

  createdAt

The timestamp when the channel is created.

@property (atomic) NSUInteger createdAt

Declared In

SBDBaseChannel.h

  data

The custom data of the channel.

@property (strong, nonatomic, nullable) NSString *data

Declared In

SBDBaseChannel.h

  customType

The custom type of the channel.

@property (strong, nonatomic, nullable) NSString *customType

Declared In

SBDBaseChannel.h

  isFrozen

The flag for a frozen channel.

@property (atomic, setter=setFreeze:) BOOL isFrozen

Availability

3.0.89 Was moved from SBDOpenChannel

Declared In

SBDBaseChannel.h

  isEphemeral

Represents the channel is ephemeral or not.

@property (nonatomic, readonly) BOOL isEphemeral

Availability

3.0.90

Declared In

SBDBaseChannel.h

– initWithDictionary:

Internal use only.

- (nullable instancetype)initWithDictionary:(NSDictionary *_Nonnull)dict

Parameters

dict

dict

Discussion

Warning: Important: DON’T use this method. This method will be unavailable.

Declared In

SBDBaseChannel.h

– sendUserMessage:completionHandler:

Sends a user message without data.

- (nonnull SBDUserMessage *)sendUserMessage:(NSString *_Nullable)message completionHandler:(nullable void ( ^ ) ( SBDUserMessage *_Nullable userMessage , SBDError *_Nullable error ))completionHandler

Parameters

message

The message text.

completionHandler

The handler block to execute. userMessage is a user message which is returned from the SendBird server. The message has a message ID.

Return Value

Returns a temporary user message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendUserMessage:targetLanguages:completionHandler:

Sends a user message without data. The message will be translated into the target languages. (Deprecated: in 3.0.116 Use sendUserMessageWithParams:completionHandler: instead.)

- (nonnull SBDUserMessage *)sendUserMessage:(NSString *_Nullable)message targetLanguages:(NSArray<NSString*> *_Nullable)targetLanguages completionHandler:(nullable void ( ^ ) ( SBDUserMessage *_Nullable userMessage , SBDError *_Nullable error ))completionHandler

Parameters

message

The message text.

targetLanguages

The target languages that the message will be translated into.

completionHandler

The handler block to execute. userMessage is a user message which is returned from the SendBird server. The message has a message ID.

Return Value

Returns a temporary user message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendUserMessage:data:completionHandler:

Sends a user message with data. (Deprecated: in 3.0.116 Use sendUserMessageWithParams:completionHandler: instead.)

- (nonnull SBDUserMessage *)sendUserMessage:(NSString *_Nullable)message data:(NSString *_Nullable)data completionHandler:(nullable void ( ^ ) ( SBDUserMessage *_Nullable userMessage , SBDError *_Nullable error ))completionHandler

Parameters

message

The message text.

data

The message data.

completionHandler

The handler block to execute. userMessage is a user message which is returned from the SendBird server. The message has a message ID.

Return Value

Returns a temporary user message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendUserMessage:data:targetLanguages:completionHandler:

Sends a user message with data. The message will be translated into the target languages. (Deprecated: in 3.0.116 Use sendUserMessageWithParams:completionHandler: instead.)

- (nonnull SBDUserMessage *)sendUserMessage:(NSString *_Nullable)message data:(NSString *_Nullable)data targetLanguages:(NSArray<NSString*> *_Nullable)targetLanguages completionHandler:(nullable void ( ^ ) ( SBDUserMessage *_Nullable userMessage , SBDError *_Nullable error ))completionHandler

Parameters

message

The message text.

data

The message data.

targetLanguages

The target languages that the message will be translated into.

completionHandler

The handler block to execute. userMessage is a user message which is returned from the SendBird server. The message has a message ID.

Return Value

Returns a temporary user message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendUserMessage:data:customType:completionHandler:

Sends a user message with data and custom message type. (Deprecated: in 3.0.116 Use sendUserMessageWithParams:completionHandler: instead.)

- (nonnull SBDUserMessage *)sendUserMessage:(NSString *_Nullable)message data:(NSString *_Nullable)data customType:(NSString *_Nullable)customType completionHandler:(nullable void ( ^ ) ( SBDUserMessage *_Nullable userMessage , SBDError *_Nullable error ))completionHandler

Parameters

message

The message text.

data

The message data.

customType

Custom message type.

completionHandler

The handler block to execute. userMessage is a user message which is returned from the SendBird server. The message has a message ID.

Return Value

Returns a temporary user message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendUserMessage:data:customType:targetLanguages:completionHandler:

Sends a user message with data and custom message type. The message will be translated into the target languages. (Deprecated: in 3.0.116 Use sendUserMessageWithParams:completionHandler: instead.)

- (nonnull SBDUserMessage *)sendUserMessage:(NSString *_Nullable)message data:(NSString *_Nullable)data customType:(NSString *_Nullable)customType targetLanguages:(NSArray<NSString*> *_Nullable)targetLanguages completionHandler:(nullable void ( ^ ) ( SBDUserMessage *_Nullable userMessage , SBDError *_Nullable error ))completionHandler

Parameters

message

The message text.

data

The message data.

customType

Custom message type.

targetLanguages

The target languages that the message will be translated into.

completionHandler

The handler block to execute. userMessage is a user message which is returned from the SendBird server. The message has a message ID.

Return Value

Returns a temporary user message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendUserMessageWithParams:completionHandler:

Sends a string message of params. The message is translated into the target languages.

- (nonnull SBDUserMessage *)sendUserMessageWithParams:(nonnull SBDUserMessageParams *)params completionHandler:(nullable void ( ^ ) ( SBDUserMessage *_Nullable userMessage , SBDError *_Nullable error ))completionHandler

Parameters

params

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

completionHandler

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

Return Value

Returns a temporary user message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– resendUserMessageWithMessage:completionHandler:

Attempts to resend a failed user message received by the failure callback. Only failed message MUST be passed, not a succeeded message or a pending message

- (void)resendUserMessageWithMessage:(nonnull SBDUserMessage *)failedMessage completionHandler:(nullable SBDUserMessageHandler)completionHandler

Parameters

failedMessage

A message to send. A failed message is passed to the callback when fails to send a message

completionHandler

The handler block to be executed after the message is sent. This block has no return value and takes two arguments. One is a user message. If the message is successfully sent, the complete message instance is delivered. If the message fails to be sent, a failed message based on the pending message is delivered. Another factor is errors. If the message fails to be sent, a message error is dispatched

Availability

3.0.141 @code SBDUserMessageParams *params = [[SBDUserMessageParams alloc] initWithMessage:text_message]; // set some properties of params

[channel sendUserMessageWithParams:params completionHandler:^(SBDUserMessage * Nullable message, SBDError * Nullable error) { if (error != nil) { // handle failure of sending message // if user wants to resend… [channel resendUserMessageWithMessage:message completionHandler:^(SBDUserMessage * Nullable message, SBDError * Nullable error) { // do something. }]; } else { // success to send message } }]; @endcode

Declared In

SBDBaseChannel.h

– sendFileMessageWithBinaryData:filename:type:size:data:completionHandler:

Sends a file message with binary data. The binary data is uploaded to SendBird file storage and a URL of the file will be generated.

- (nonnull SBDFileMessage *)sendFileMessageWithBinaryData:(NSData *_Nonnull)file filename:(NSString *_Nonnull)filename type:(NSString *_Nonnull)type size:(NSUInteger)size data:(NSString *_Nullable)data completionHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nullable fileMessage , SBDError *_Nullable error ))completionHandler

Parameters

file

File data.

filename

Filename.

type

The mime type of file.

size

File size.

data

Custom data.

completionHandler

The handler block to execute. fileMessage is a user message which is returned from the SendBird server. The message has a message ID and an URL.

Return Value

Returns a temporary file message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendFileMessageWithBinaryData:filename:type:size:data:customType:completionHandler:

Sends a file message with binary data. The binary data is uploaded to SendBird file storage and a URL of the file will be generated. (Deprecated: in 3.0.116 Use sendFileMessageWithParams:completionHandler: instead.)

- (nonnull SBDFileMessage *)sendFileMessageWithBinaryData:(NSData *_Nonnull)file filename:(NSString *_Nonnull)filename type:(NSString *_Nonnull)type size:(NSUInteger)size data:(NSString *_Nullable)data customType:(NSString *_Nullable)customType completionHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nullable fileMessage , SBDError *_Nullable error ))completionHandler

Parameters

file

File data.

filename

Filename.

type

The mime type of file.

size

File size.

data

Custom data.

customType

Custom message type.

completionHandler

The handler block to execute. fileMessage is a user message which is returned from the SendBird server. The message has a message ID and an URL.

Return Value

Returns a temporary file message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendFileMessageWithUrl:size:type:data:completionHandler:

Sends a file message with file URL. (Deprecated: in 3.0.29.)

- (nonnull SBDFileMessage *)sendFileMessageWithUrl:(NSString *_Nonnull)url size:(NSUInteger)size type:(NSString *_Nonnull)type data:(NSString *_Nullable)data completionHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nullable fileMessage , SBDError *_Nullable error ))completionHandler

Parameters

url

File URL.

size

File size.

type

The type of file.

data

Custom data.

completionHandler

The handler block to execute. fileMessage is a user message which is returned from the SendBird server. The message has a message ID.

Return Value

Returns a temporary file message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendFileMessageWithUrl:filename:size:type:data:completionHandler:

Sends a file message with file URL.

- (nonnull SBDFileMessage *)sendFileMessageWithUrl:(NSString *_Nonnull)url filename:(NSString *_Nullable)filename size:(NSUInteger)size type:(NSString *_Nonnull)type data:(NSString *_Nullable)data completionHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nullable fileMessage , SBDError *_Nullable error ))completionHandler

Parameters

url

File URL.

filename

Filename.

size

File size.

type

The type of file.

data

Custom data.

completionHandler

The handler block to execute. fileMessage is a user message which is returned from the SendBird server. The message has a message ID.

Return Value

Returns a temporary file message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendFileMessageWithUrl:size:type:data:customType:completionHandler:

Sends a file message with file URL and custom message type. (Deprecated: in 3.0.29.)

- (nonnull SBDFileMessage *)sendFileMessageWithUrl:(NSString *_Nonnull)url size:(NSUInteger)size type:(NSString *_Nonnull)type data:(NSString *_Nullable)data customType:(NSString *_Nullable)customType completionHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nullable fileMessage , SBDError *_Nullable error ))completionHandler

Parameters

url

File URL.

size

File size.

type

The type of file.

data

Custom data.

customType

Custom message type.

completionHandler

The handler block to execute. fileMessage is a user message which is returned from the SendBird server. The message has a message ID.

Return Value

Returns a temporary file message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendFileMessageWithUrl:filename:size:type:data:customType:completionHandler:

Sends a file message with file URL and custom message type.

- (nonnull SBDFileMessage *)sendFileMessageWithUrl:(NSString *_Nonnull)url filename:(NSString *_Nullable)filename size:(NSUInteger)size type:(NSString *_Nonnull)type data:(NSString *_Nullable)data customType:(NSString *_Nullable)customType completionHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nullable fileMessage , SBDError *_Nullable error ))completionHandler

Parameters

url

File URL.

filename

Filename.

size

File size.

type

The type of file.

data

Custom data.

customType

Custom message type.

completionHandler

The handler block to execute. fileMessage is a user message which is returned from the SendBird server. The message has a message ID.

Return Value

Returns a temporary file message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendFileMessageWithBinaryData:filename:type:size:data:progressHandler:completionHandler:

Sends a file message with binary data. The binary data is uploaded to SendBird file storage and a URL of the file will be generated. The uploading progress callback can be implemented. (Deprecated: in 3.0.116 Use sendFileMessageWithParams:completionHandler: instead.)

- (nonnull SBDFileMessage *)sendFileMessageWithBinaryData:(NSData *_Nonnull)file filename:(NSString *_Nonnull)filename type:(NSString *_Nonnull)type size:(NSUInteger)size data:(NSString *_Nullable)data progressHandler:(nullable void ( ^ ) ( int64_t bytesSent , int64_t totalBytesSent , int64_t totalBytesExpectedToSend ))progressHandler completionHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nullable fileMessage , SBDError *_Nullable error ))completionHandler

Parameters

file

File data.

filename

Filename.

type

The mime type of file.

size

File size.

data

Custom data.

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. fileMessage is a user message which is returned from the SendBird server. The message has a message ID and an URL.

Return Value

Returns a temporary file message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendFileMessageWithBinaryData:filename:type:size:data:customType:progressHandler:completionHandler:

Sends a file message with binary data. The binary data is uploaded to SendBird file storage and a URL of the file will be generated. The uploading progress callback can be implemented. (Deprecated: in 3.0.116 Use sendFileMessageWithParams:completionHandler: instead.)

- (nonnull SBDFileMessage *)sendFileMessageWithBinaryData:(NSData *_Nonnull)file filename:(NSString *_Nonnull)filename type:(NSString *_Nonnull)type size:(NSUInteger)size data:(NSString *_Nullable)data customType:(NSString *_Nullable)customType progressHandler:(nullable void ( ^ ) ( int64_t bytesSent , int64_t totalBytesSent , int64_t totalBytesExpectedToSend ))progressHandler completionHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nullable fileMessage , SBDError *_Nullable error ))completionHandler

Parameters

file

File data.

filename

Filename.

type

The mime type of file.

size

File size.

data

Custom data.

customType

Custom message type.

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. fileMessage is a user message which is returned from the SendBird server. The message has a message ID and an URL.

Return Value

Returns a temporary file message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendFileMessageWithBinaryData:filename:type:size:thumbnailSizes:data:customType:progressHandler:completionHandler:

Sends a file message with binary data. The binary data is uploaded to SendBird file storage and a URL of the file will be generated. The uploading progress callback can be implemented.

- (nonnull SBDFileMessage *)sendFileMessageWithBinaryData:(NSData *_Nonnull)file filename:(NSString *_Nonnull)filename type:(NSString *_Nonnull)type size:(NSUInteger)size thumbnailSizes:(NSArray<SBDThumbnailSize*> *_Nullable)thumbnailSizes data:(NSString *_Nullable)data customType:(NSString *_Nullable)customType progressHandler:(nullable void ( ^ ) ( int64_t bytesSent , int64_t totalBytesSent , int64_t totalBytesExpectedToSend ))progressHandler completionHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nullable fileMessage , SBDError *_Nullable error ))completionHandler

Parameters

file

File data.

filename

Filename.

type

The mime type of file.

size

File size.

thumbnailSizes

Thumbnail sizes. This parameter is the array of SBDThumbnailSize object and works for image file only.

data

Custom data.

customType

Custom message type.

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. fileMessage is a user message which is returned from the SendBird server. The message has a message ID and an URL.

Return Value

Returns a temporary file message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendFileMessageWithFilePath:type:thumbnailSizes:data:customType:progressHandler:completionHandler:

Sends a file message with binary data. The binary data is uploaded to SendBird file storage and a URL of the file will be generated. The uploading progress callback can be implemented.

- (nonnull SBDFileMessage *)sendFileMessageWithFilePath:(NSString *_Nonnull)filepath type:(NSString *_Nonnull)type thumbnailSizes:(NSArray<SBDThumbnailSize*> *_Nullable)thumbnailSizes data:(NSString *_Nullable)data customType:(NSString *_Nullable)customType progressHandler:(nullable void ( ^ ) ( int64_t bytesSent , int64_t totalBytesSent , int64_t totalBytesExpectedToSend ))progressHandler completionHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nullable fileMessage , SBDError *_Nullable error ))completionHandler

Parameters

filepath

File path to be sent.

type

The mime type of file.

thumbnailSizes

Thumbnail sizes. This parameter is the array of SBDThumbnailSize object and works for image file only.

data

Custom data.

customType

Custom message type.

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. fileMessage is a user message which is returned from the SendBird server. The message has a message ID and an URL.

Return Value

Returns a temporary file message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendFileMessageWithParams:completionHandler:

Sends a file message with file or file URL of params without progress. If the params has a binary file, it will upload data to Sendbird storage. If not, the params has a file url, it will send a message with file url.

- (nonnull SBDFileMessage *)sendFileMessageWithParams:(nonnull SBDFileMessageParams *)params completionHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nullable fileMessage , SBDError *_Nullable error ))completionHandler

Parameters

params

The instance of SBDFileMessageParams that can has parameters related with file.

completionHandler

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

Return Value

Returns a temporary file message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendFileMessageWithParams:progressHandler:completionHandler:

Sends a file message with file or file URL of params with progress. If the params has a binary file, it will upload data to Sendbird storage. If not, the params has a file url, it will send a message with file url.

- (nonnull SBDFileMessage *)sendFileMessageWithParams:(nonnull SBDFileMessageParams *)params progressHandler:(nullable void ( ^ ) ( int64_t bytesSent , int64_t totalBytesSent , int64_t totalBytesExpectedToSend ))progressHandler completionHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nullable fileMessage , SBDError *_Nullable error ))completionHandler

Parameters

params

The instance of SBDFileMessageParams that can has parameters related with file.

progressHandler

The handler block to be used to monitor progression. bytesSent is the number of bytes sent since 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 after the message was sent. This block has no return value and takes two argument, one is a file message was sent and other is an error made when there is something wrong to message.

Return Value

Returns a temporary file message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Declared In

SBDBaseChannel.h

– sendFileMessagesWithParams:progressHandler:sentMessageHandler:completionHandler:

Sends a file message with file or file URL of params with progress. If the params has a binary file, it will upload data to Sendbird storage. If not, the params has a file url, it will send a message with file url.

- (nonnull NSArray<SBDFileMessage*> *)sendFileMessagesWithParams:(nonnull NSArray<SBDFileMessageParams*> *)params progressHandler:(nullable void ( ^ ) ( NSString *_Nullable requestId , int64_t bytesSent , int64_t totalBytesSent , int64_t totalBytesExpectedToSend ))progressHandler sentMessageHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nonnull message , SBDError *_Nullable error ))sentMessageHandler completionHandler:(nullable void ( ^ ) ( SBDError *_Nullable error ))completionHandler

Parameters

params

The instance of SBDFileMessageParams that can has parameters related with file.

progressHandler

The handler block to be used to monitor progression. bytesSent is the number of bytes sent since 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:.

sentMessageHandler

The handler block to be executed after each message was sent. This block has no return value and takes two argument, one is a file message was sent and other is an error made when there is something wrong to message.

completionHandler

The handler block to be executed after every message was sent. This block has no return value and takes an error. If the sending message can’t start at all because of the connection issue, the error isn’t nil.

Return Value

Returns a temporary file message being sent to the SendBird server. The message has a request ID instead of a message ID. The request status of the message is pending. If you try to send a message with an invalid parameter, the returned message is a user message with no properties. You can perform a validation of pending message by checking for the existence of the request ID.

Availability

3.0.116

Declared In

SBDBaseChannel.h

– resendFileMessageWithMessage:binaryData:completionHandler:

Attempts to resend a failed file message received by the failure callback. Only failed message MUST be passed, not a succeeded message or a pending message. If the failed message has a file URL, it means the failed message was created after failure of sending a file message command. So the method retries to send a file message command. If the failed message does not have a file URL, it means the failed message was created from failure of uploading a binary data. So the method retries to upload a binary data frist.

- (void)resendFileMessageWithMessage:(nonnull SBDFileMessage *)failedMessage binaryData:(nullable NSData *)binaryData completionHandler:(nullable SBDFileMessageHandler)completionHandler

Parameters

failedMessage

A message to send. A failed message is passed to the callback when fails to send a message

binaryData

Data to resend. If the failed message has a file URL, the method will not send binary data. If the failed message does not have a file URL, the method will send binary data first and send a file message command with file url.

completionHandler

The handler block to be executed after the message is sent. This block has no return value and takes two arguments. One is a file message. If the message is successfully sent, the complete message instance is delivered. If the message fails to be sent, a failed message based on the pending message is delivered except invalid parameter error. If failed because of invalid parameter, message is nil. Another factor is errors. If the message fails to be sent, a message error is dispatched.

Availability

3.0.147 @code SBDFileMessageParams *params = [[SBDFileMessageParams alloc] initWithFile:binaryData]; // set some properties of params [channel sendFileMessageWithParams:params completionHandler:^(SBDFileMessage * Nullable message, SBDError * Nullable error) { if (error != nil) { // handle failure of sending message // if user wants to resend… [channel resendFileMessageWithMessage:message binaryData:params.file completionHandler:^(SBDFileMessage * Nullable message, SBDError * Nullable error) { // do something. }]; } else { // success to send message } }]; @endcode

Declared In

SBDBaseChannel.h

– resendFileMessageWithMessage:binaryData:progressHandler:completionHandler:

Attempts to resend a failed file message received by the failure callback. Only failed message MUST be passed, not a succeeded message or a pending message. If the failed message has a file URL, it means the failed message was created after failure of sending a file message command. So the method retries to send a file message command. If the failed message does not have a file URL, it means the failed message was created from failure of uploading a binary data. So the method retries to upload a binary data frist.

- (void)resendFileMessageWithMessage:(nonnull SBDFileMessage *)failedMessage binaryData:(nullable NSData *)binaryData progressHandler:(nullable SBDBinaryProgressHandler)progressHandler completionHandler:(nullable SBDFileMessageHandler)completionHandler

Parameters

failedMessage

A message to send. A failed message is passed to the callback when fails to send a message

binaryData

Data to resend. If the failed message has a file URL, the method will not send binary data. If the failed message does not have a file URL, the method will send binary data first and send a file message command with file url.

progressHandler

The handler block to be used to monitor progression. bytesSent is the number of bytes sent since 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 after the message is sent. This block has no return value and takes two arguments. One is a file message. If the message is successfully sent, the complete message instance is delivered. If the message fails to be sent, a failed message based on the pending message is delivered except invalid parameter error. If failed because of invalid parameter, message is nil. Another factor is errors. If the message fails to be sent, a message error is dispatched.

Availability

3.0.147 @code SBDFileMessageParams *params = [[SBDFileMessageParams alloc] initWithFile:binaryData]; // set some properties of params [channel sendFileMessageWithParams:params completionHandler:^(SBDFileMessage * Nullable message, SBDError * Nullable error) { if (error != nil) { // handle failure of sending message // if user wants to resend… [channel resendFileMessageWithMessage:failedMessage binaryData:params.file progressHandler:^(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) { // do something in progress } completionHandler:^(SBDFileMessage * Nullable message, SBDError * Nullable error) { // do something. }]; } else { // success to send message } }]; @endcode

Declared In

SBDBaseChannel.h

– createPreviousMessageListQuery

Creates SBDPreviousMessageListQuery instance for getting the previous messages list of the channel.

- (nullable SBDPreviousMessageListQuery *)createPreviousMessageListQuery

Return Value

Returns the message list of the channel.

Declared In

SBDBaseChannel.h

– createMessageListQuery

Creates SBDMessageListQuery instance for getting the previous messages list of the channel. (Deprecated: in 3.0.28.)

- (nullable SBDMessageListQuery *)createMessageListQuery

Return Value

Returns the message list of the channel.

Declared In

SBDBaseChannel.h

– createOperatorListQuery

Creates SBDOperatorListQuery instance for getting operators in the channel.

- (nullable SBDOperatorListQuery *)createOperatorListQuery

Return Value

The operator list in the channel.

Availability

3.0.94

Declared In

SBDBaseChannel.h

– createMetaCounters:completionHandler:

Creates the meta counters for the channel.

- (void)createMetaCounters:(NSDictionary<NSString*,NSNumber*> *_Nonnull)metaCounters completionHandler:(nullable void ( ^ ) ( NSDictionary<NSString*,NSNumber*> *_Nullable metaCounters , SBDError *_Nullable error ))completionHandler

Parameters

metaCounters

The meta counters to be set.

completionHandler

The handler block to execute. metaCounters is the meta counters which are set on SendBird server.

Declared In

SBDBaseChannel.h

– getMetaCountersWithKeys:completionHandler:

Gets the meta counters with keys for the channel.

- (void)getMetaCountersWithKeys:(NSArray<NSString*> *_Nullable)keys completionHandler:(nullable void ( ^ ) ( NSDictionary<NSString*,NSNumber*> *_Nullable metaCounters , SBDError *_Nullable error ))completionHandler

Parameters

keys

The keys to get meta counters.

completionHandler

The handler block to execute. metaCounters is the meta counters which are set on SendBird server.

Declared In

SBDBaseChannel.h

– getAllMetaCountersWithCompletionHandler:

Gets all meta counters for the channel.

- (void)getAllMetaCountersWithCompletionHandler:(nullable void ( ^ ) ( NSDictionary<NSString*,NSNumber*> *_Nullable metaCounters , SBDError *_Nullable error ))completionHandler

Parameters

completionHandler

The handler block to execute. metaCounters is the meta counters which are returned from SendBird server.

Declared In

SBDBaseChannel.h

– updateMetaCounters:completionHandler:

Updates the meta counters for the channel.

- (void)updateMetaCounters:(NSDictionary<NSString*,NSNumber*> *_Nonnull)metaCounters completionHandler:(nullable void ( ^ ) ( NSDictionary<NSString*,NSNumber*> *_Nullable metaCounters , SBDError *_Nullable error ))completionHandler

Parameters

metaCounters

The meta counters to be updated.

completionHandler

The handler block to execute. metaCounters is the meta counters which are updated on SendBird server.

Declared In

SBDBaseChannel.h

– increaseMetaCounters:completionHandler:

Increases the meta counters for the channel.

- (void)increaseMetaCounters:(NSDictionary<NSString*,NSNumber*> *_Nonnull)metaCounters completionHandler:(nullable void ( ^ ) ( NSDictionary<NSString*,NSNumber*> *_Nullable metaCounters , SBDError *_Nullable error ))completionHandler

Parameters

metaCounters

The meta counters to be increased.

completionHandler

The handler block to execute. metaCounters is the meta counters which are increased on SendBird server.

Declared In

SBDBaseChannel.h

– decreaseMetaCounters:completionHandler:

Decreases the meta counters for the channel.

- (void)decreaseMetaCounters:(NSDictionary<NSString*,NSNumber*> *_Nonnull)metaCounters completionHandler:(nullable void ( ^ ) ( NSDictionary<NSString*,NSNumber*> *_Nullable metaCounters , SBDError *_Nullable error ))completionHandler

Parameters

metaCounters

The meta counters to be decreased.

completionHandler

The handler block to execute. metaCounters is the meta counters which are decreased on SendBird server.

Declared In

SBDBaseChannel.h

– deleteMetaCountersWithKey:completionHandler:

Deletes the meta counters with key for the channel.

- (void)deleteMetaCountersWithKey:(NSString *_Nonnull)key completionHandler:(nullable void ( ^ ) ( SBDError *_Nullable error ))completionHandler

Parameters

key

The key to be deleted.

completionHandler

The handler block to execute.

Declared In

SBDBaseChannel.h

– deleteAllMetaCountersWithCompletionHandler:

Deletes all meta counters for the channel.

- (void)deleteAllMetaCountersWithCompletionHandler:(nullable void ( ^ ) ( SBDError *_Nullable error ))completionHandler

Parameters

completionHandler

The handler block to execute.

Declared In

SBDBaseChannel.h

– createMetaData:completionHandler:

Creates the meta data for the channel.

- (void)createMetaData:(NSDictionary<NSString*,NSString*> *_Nonnull)metaData completionHandler:(nullable void ( ^ ) ( NSDictionary<NSString*,NSString*> *_Nullable metaData , SBDError *_Nullable error ))completionHandler

Parameters

metaData

The meta data to be set.

completionHandler

The handler block to execute. metaData is the meta data which are set on SendBird server.

Declared In

SBDBaseChannel.h

– getMetaDataWithKeys:completionHandler:

Gets the meta data for the channel.

- (void)getMetaDataWithKeys:(NSArray<NSString*> *_Nullable)keys completionHandler:(nullable void ( ^ ) ( NSDictionary<NSString*,NSObject*> *_Nullable metaData , SBDError *_Nullable error ))completionHandler

Parameters

keys

The keys to get meta data.

completionHandler

The handler block to execute. metaData is the meta data which are set on SendBird server.

Declared In

SBDBaseChannel.h

– getAllMetaDataWithCompletionHandler:

Gets all meta data for the channel.

- (void)getAllMetaDataWithCompletionHandler:(nullable void ( ^ ) ( NSDictionary<NSString*,NSObject*> *_Nullable metaData , SBDError *_Nullable error ))completionHandler

Parameters

completionHandler

The handler block to execute. metaData is the meta data which are set on SendBird server.

Declared In

SBDBaseChannel.h

– updateMetaData:completionHandler:

Updates the meta data for the channel.

- (void)updateMetaData:(NSDictionary<NSString*,NSString*> *_Nonnull)metaData completionHandler:(nullable void ( ^ ) ( NSDictionary<NSString*,NSObject*> *_Nullable metaData , SBDError *_Nullable error ))completionHandler

Parameters

metaData

The meta data to be updated.

completionHandler

The handler block to execute. metaData is the meta counters which are updated on SendBird server.

Declared In

SBDBaseChannel.h

– deleteMetaDataWithKey:completionHandler:

Deletes meta data with key for the channel.

- (void)deleteMetaDataWithKey:(NSString *_Nonnull)key completionHandler:(nullable void ( ^ ) ( SBDError *_Nullable error ))completionHandler

Parameters

key

The key to be deleted.

completionHandler

The handler block to execute.

Declared In

SBDBaseChannel.h

– deleteAllMetaDataWithCompletionHandler:

Deletes all meta data for the channel.

- (void)deleteAllMetaDataWithCompletionHandler:(nullable void ( ^ ) ( SBDError *_Nullable error ))completionHandler

Parameters

completionHandler

The handler block to execute.

Declared In

SBDBaseChannel.h

– deleteMessage:completionHandler:

Deletes a message. The message’s sender has to be the current user.

- (void)deleteMessage:(SBDBaseMessage *_Nonnull)message completionHandler:(nullable void ( ^ ) ( SBDError *_Nullable error ))completionHandler

Parameters

message

The message to be deleted.

completionHandler

The handler block to execute.

Declared In

SBDBaseChannel.h

– updateUserMessage:messageText:data:customType:completionHandler:

Updates a user message. The message text, data, and custom type can be updated.

- (void)updateUserMessage:(SBDUserMessage *_Nonnull)userMessage messageText:(NSString *_Nullable)messageText data:(NSString *_Nullable)data customType:(NSString *_Nullable)customType completionHandler:(nullable void ( ^ ) ( SBDUserMessage *_Nullable userMessage , SBDError *_Nullable error ))completionHandler

Parameters

userMessage

The user message to be updated.

messageText

New message text.

data

New data.

customType

New custom type.

completionHandler

The handler block to execute.

Declared In

SBDBaseChannel.h

– updateUserMessageWithMessageId:userMessageParams:completionHandler:

Updates a user message. The text message, data, custom type from user message params can be updated.

- (void)updateUserMessageWithMessageId:(long long)messageId userMessageParams:(nonnull SBDUserMessageParams *)params completionHandler:(nullable void ( ^ ) ( SBDUserMessage *_Nullable message , SBDError *_Nullable error ))completionHandler

Parameters

messageId

The message ID of the message to be updated.

params

The user message params that has updating fields.

completionHandler

The handler block to be executed after update. This block has no return value and takes two argument. the one is updated message type of SBDUserMessage. the other is an error made when there is something wrong to process.

Availability

3.0.110

Declared In

SBDBaseChannel.h

– updateFileMessage:data:customType:completionHandler:

Updates a file message. The data and custom type can be updated.

- (void)updateFileMessage:(SBDFileMessage *_Nonnull)fileMessage data:(NSString *_Nullable)data customType:(NSString *_Nullable)customType completionHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nullable fileMessage , SBDError *_Nullable error ))completionHandler

Parameters

fileMessage

The file message to be updated.

data

New data.

customType

New custom type.

completionHandler

The handler block to execute.

Declared In

SBDBaseChannel.h

– updateFileMessageWithMessageId:fileMessageParams:completionHandler:

Updates a file message. The data, custom type from file message params can be updated.

- (void)updateFileMessageWithMessageId:(long long)messageId fileMessageParams:(nonnull SBDFileMessageParams *)params completionHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nullable message , SBDError *_Nullable error ))completionHandler

Parameters

messageId

The message ID of the message to be updated.

params

The file message params that has updating fields.

completionHandler

The handler block to be executed after update. This block has no return value and takes two argument. the one is updated message type of SBDFileMessage. the other is an error made when there is something wrong to process.

Availability

3.0.110

Declared In

SBDBaseChannel.h

– translateUserMessage:targetLanguages:completionHandler:

Requests to translate the text message into the target languages. You can get a user message with the translations property after the request, but the request does not trigger an update event on the message and does not get the message by getMessageChangeLogsWithToken:. If you request a message through methods such as getPreivousMessage: or getNextMessage:, you will get a translated message. A translation request can affect not only your message, but also other people’s messages.

- (void)translateUserMessage:(nonnull SBDUserMessage *)message targetLanguages:(nonnull NSArray<NSString*> *)targetLanguages completionHandler:(nullable SBDUserMessageHandler)completionHandler

Parameters

message

The string type of the message of the user message instance will be translated.

targetLanguages

The target languages that the message will be translated into. e.g. @“en”, @“es”, @“ch”

completionHandler

The handler block to be executed after translation. This block has no return value and takes two arguments. One is a user message. If succeeded to translate text of the message, the message instance with translations is delivered. If failed to translate, nil is delivered. Another factor is an error. If failed to request, an error is dispatched.

Availability

3.0.148 @code SBDUserMessage *userMessage; // received from event or get from API (getPreviousMessages:) [channel translateUserMessage:userMessage targerLanguages:target_languages completionHandler:^(SBDUserMessage * Nullable message, SBDError * Nullable error) { if (error != nil) { // handle error return; }

NSDictionary *translations = message.translations;
// do somthing.

}]; @endcode

Declared In

SBDBaseChannel.h

– isGroupChannel

Checks the channel type.

- (BOOL)isGroupChannel

Return Value

If YES, this channel is a group channel.

Declared In

SBDBaseChannel.h

– isOpenChannel

Checks the channel type.

- (BOOL)isOpenChannel

Return Value

If YES, this channel is an open channel.

Declared In

SBDBaseChannel.h

– getNextMessagesByTimestamp:limit:reverse:completionHandler:

Gets the next messages by the timestamp with a limit and ordering. (Deprecated: in v3.0.40.)

- (void)getNextMessagesByTimestamp:(long long)timestamp limit:(NSInteger)limit reverse:(BOOL)reverse completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

timestamp

The standard timestamp to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Declared In

SBDBaseChannel.h

– getNextMessagesByTimestamp:limit:reverse:messageType:customType:completionHandler:

Gets the next messages by the timestamp with a limit and ordering.

- (void)getNextMessagesByTimestamp:(long long)timestamp limit:(NSInteger)limit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

timestamp

The standard timestamp to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Declared In

SBDBaseChannel.h

– getNextMessagesByTimestamp:limit:reverse:messageType:customType:senderUserIds:completionHandler:

Gets the next messages by the timestamp with a limit and ordering.

- (void)getNextMessagesByTimestamp:(long long)timestamp limit:(NSInteger)limit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType senderUserIds:(NSArray<NSString*> *_Nullable)senderUserIds completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

timestamp

The standard timestamp to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

senderUserIds

Returns messages whose sender user id matches sender user ids.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Availability

3.0.106

Declared In

SBDBaseChannel.h

– getNextMessagesByTimestamp:limit:reverse:messageType:customType:senderUserIds:includeMetaArray:completionHandler:

Gets the next messages by the timestamp. The messages can have meta array.

- (void)getNextMessagesByTimestamp:(long long)timestamp limit:(NSInteger)limit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType senderUserIds:(NSArray<NSString*> *_Nullable)senderUserIds includeMetaArray:(BOOL)includeMetaArray completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

timestamp

The standard timestamp to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If YES, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

senderUserIds

Returns messages whose sender user id matches sender user ids.

includeMetaArray

If YES, the messages has meta array.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Availability

3.0.116

Declared In

SBDBaseChannel.h

– getNextMessagesByTimestamp:inclusiveTimestamp:limit:reverse:messageType:customType:senderUserIds:includeMetaArray:completionHandler:

Requests to next messages by the timestamp with filters of inclusive timestamp, limit, reverse, message type, custom type, sender user ids, include meta array.

- (void)getNextMessagesByTimestamp:(long long)timestamp inclusiveTimestamp:(BOOL)inclusiveTimestamp limit:(NSInteger)limit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType senderUserIds:(NSArray<NSString*> *_Nullable)senderUserIds includeMetaArray:(BOOL)includeMetaArray completionHandler:(nullable SBDGetMessagesHandler)completionHandler

Parameters

timestamp

The standard timestamp to load messages.

inclusiveTimestamp

Whether the response has messages including timestamp or not. If true (YES), results contain messages that created at the timestamp. If false (NO), results have messages that created after the timestamp

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If YES, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

senderUserIds

Returns messages whose sender user id matches sender user ids.

includeMetaArray

If YES, the messages has meta array.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Availability

3.0.140

Declared In

SBDBaseChannel.h

– getPreviousMessagesByTimestamp:limit:reverse:completionHandler:

Gets the previous messages by the timestamp with a limit and ordering. (Deprecated: in v3.0.40.)

- (void)getPreviousMessagesByTimestamp:(long long)timestamp limit:(NSInteger)limit reverse:(BOOL)reverse completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

timestamp

The standard timestamp to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Declared In

SBDBaseChannel.h

– getPreviousMessagesByTimestamp:limit:reverse:messageType:customType:completionHandler:

Gets the previous messages by the timestamp with a limit and ordering.

- (void)getPreviousMessagesByTimestamp:(long long)timestamp limit:(NSInteger)limit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

timestamp

The standard timestamp to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Declared In

SBDBaseChannel.h

– getPreviousMessagesByTimestamp:limit:reverse:messageType:customType:senderUserIds:completionHandler:

Gets the previous messages by the timestamp with a limit and ordering.

- (void)getPreviousMessagesByTimestamp:(long long)timestamp limit:(NSInteger)limit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType senderUserIds:(NSArray<NSString*> *_Nullable)senderUserIds completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

timestamp

The standard timestamp to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

senderUserIds

Returns messages whose sender user id matches sender user ids.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Availability

3.0.106

Declared In

SBDBaseChannel.h

– getPreviousMessagesByTimestamp:limit:reverse:messageType:customType:senderUserIds:includeMetaArray:completionHandler:

Gets the previous messages by the timestamp. The messages can have meta array.

- (void)getPreviousMessagesByTimestamp:(long long)timestamp limit:(NSInteger)limit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType senderUserIds:(NSArray<NSString*> *_Nullable)senderUserIds includeMetaArray:(BOOL)includeMetaArray completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

timestamp

The standard timestamp to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If YES, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

senderUserIds

Returns messages whose sender user id matches sender user ids.

includeMetaArray

If YES, the messages has meta array.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Availability

3.0.116

Declared In

SBDBaseChannel.h

– getPreviousMessagesByTimestamp:inclusiveTimestamp:limit:reverse:messageType:customType:senderUserIds:includeMetaArray:completionHandler:

Requests to previous messages by the timestamp with filters of inclusive timestamp, limit, reverse, message type, custom type, sender user ids, include meta array.

- (void)getPreviousMessagesByTimestamp:(long long)timestamp inclusiveTimestamp:(BOOL)inclusiveTimestamp limit:(NSInteger)limit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType senderUserIds:(NSArray<NSString*> *_Nullable)senderUserIds includeMetaArray:(BOOL)includeMetaArray completionHandler:(nullable SBDGetMessagesHandler)completionHandler

Parameters

timestamp

The standard timestamp to load messages.

inclusiveTimestamp

Whether the response has messages including timestamp or not. If true (YES), results contain messages that created at the timestamp. If false (NO), results have messages that created before the timestamp

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If YES, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

senderUserIds

Returns messages whose sender user id matches sender user ids.

includeMetaArray

If YES, the messages has meta array.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Availability

3.0.140

Declared In

SBDBaseChannel.h

– getPreviousAndNextMessagesByTimestamp:prevLimit:nextLimit:reverse:completionHandler:

Gets the previous and next message by the timestamp with a limit and ordering. (Deprecated: in v3.0.40.)

- (void)getPreviousAndNextMessagesByTimestamp:(long long)timestamp prevLimit:(NSInteger)prevLimit nextLimit:(NSInteger)nextLimit reverse:(BOOL)reverse completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

timestamp

The standard timestamp to load messages.

prevLimit

The previous limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

nextLimit

The next limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Declared In

SBDBaseChannel.h

– getPreviousAndNextMessagesByTimestamp:prevLimit:nextLimit:reverse:messageType:customType:completionHandler:

Gets the previous and next message by the timestamp with a limit and ordering.

- (void)getPreviousAndNextMessagesByTimestamp:(long long)timestamp prevLimit:(NSInteger)prevLimit nextLimit:(NSInteger)nextLimit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

timestamp

The standard timestamp to load messages.

prevLimit

The previous limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

nextLimit

The next limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Declared In

SBDBaseChannel.h

– getPreviousAndNextMessagesByTimestamp:prevLimit:nextLimit:reverse:messageType:customType:senderUserIds:completionHandler:

Gets the previous and next message by the timestamp with a limit and ordering.

- (void)getPreviousAndNextMessagesByTimestamp:(long long)timestamp prevLimit:(NSInteger)prevLimit nextLimit:(NSInteger)nextLimit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType senderUserIds:(NSArray<NSString*> *_Nullable)senderUserIds completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

timestamp

The standard timestamp to load messages.

prevLimit

The previous limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

nextLimit

The next limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

senderUserIds

Returns messages whose sender user id matches sender user ids.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Availability

3.0.106

Declared In

SBDBaseChannel.h

– getPreviousAndNextMessagesByTimestamp:prevLimit:nextLimit:reverse:messageType:customType:senderUserIds:includeMetaArray:completionHandler:

Gets the previous and next messages by the timestamp. The messages can have meta array.

- (void)getPreviousAndNextMessagesByTimestamp:(long long)timestamp prevLimit:(NSInteger)prevLimit nextLimit:(NSInteger)nextLimit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType senderUserIds:(NSArray<NSString*> *_Nullable)senderUserIds includeMetaArray:(BOOL)includeMetaArray completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

timestamp

The standard timestamp to load messages.

prevLimit

The previous limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

nextLimit

The next limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If YES, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

senderUserIds

Returns messages whose sender user id matches sender user ids.

includeMetaArray

If YES, the messages has meta array.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Availability

3.0.116

Declared In

SBDBaseChannel.h

– getNextMessagesByMessageId:limit:reverse:completionHandler:

Gets the next messages by the message ID with a limit and ordering. (Deprecated: in v3.0.40.)

- (void)getNextMessagesByMessageId:(long long)messageId limit:(NSInteger)limit reverse:(BOOL)reverse completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

messageId

The standard message ID to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Declared In

SBDBaseChannel.h

– getNextMessagesByMessageId:limit:reverse:messageType:customType:completionHandler:

Gets the next messages by the message ID with a limit and ordering.

- (void)getNextMessagesByMessageId:(long long)messageId limit:(NSInteger)limit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

messageId

The standard message ID to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Declared In

SBDBaseChannel.h

– getNextMessagesByMessageId:limit:reverse:messageType:customType:senderUserIds:completionHandler:

Gets the next messages by the message ID with a limit and ordering.

- (void)getNextMessagesByMessageId:(long long)messageId limit:(NSInteger)limit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType senderUserIds:(NSArray<NSString*> *_Nullable)senderUserIds completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

messageId

The standard message ID to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

senderUserIds

Returns messages whose sender user id matches sender user ids.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Availability

3.0.106

Declared In

SBDBaseChannel.h

– getNextMessagesByMessageId:limit:reverse:messageType:customType:senderUserIds:includeMetaArray:completionHandler:

Gets the next messages by the message ID. The messages can have meta array.

- (void)getNextMessagesByMessageId:(long long)messageId limit:(NSInteger)limit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType senderUserIds:(NSArray<NSString*> *_Nullable)senderUserIds includeMetaArray:(BOOL)includeMetaArray completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

messageId

The standard message ID to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If YES, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

senderUserIds

Returns messages whose sender user id matches sender user ids.

includeMetaArray

If YES, the messages has meta array.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Availability

3.0.116

Declared In

SBDBaseChannel.h

– getPreviousMessagesByMessageId:limit:reverse:completionHandler:

Gets the previous messages by the message ID with a limit and ordering. (Deprecated: in v3.0.40.)

- (void)getPreviousMessagesByMessageId:(long long)messageId limit:(NSInteger)limit reverse:(BOOL)reverse completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

messageId

The standard message ID to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Declared In

SBDBaseChannel.h

– getPreviousMessagesByMessageId:limit:reverse:messageType:customType:completionHandler:

Gets the previous messages by the message ID with a limit and ordering.

- (void)getPreviousMessagesByMessageId:(long long)messageId limit:(NSInteger)limit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

messageId

The standard message ID to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Declared In

SBDBaseChannel.h

– getPreviousMessagesByMessageId:limit:reverse:messageType:customType:senderUserIds:completionHandler:

Gets the previous messages by the message ID with a limit and ordering.

- (void)getPreviousMessagesByMessageId:(long long)messageId limit:(NSInteger)limit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType senderUserIds:(NSArray<NSString*> *_Nullable)senderUserIds completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

messageId

The standard message ID to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

senderUserIds

Returns messages whose sender user id matches sender user ids.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Availability

3.0.106

Declared In

SBDBaseChannel.h

– getPreviousMessagesByMessageId:limit:reverse:messageType:customType:senderUserIds:includeMetaArray:completionHandler:

Gets the previous messages by the message ID. The messages can have meta array.

- (void)getPreviousMessagesByMessageId:(long long)messageId limit:(NSInteger)limit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType senderUserIds:(NSArray<NSString*> *_Nullable)senderUserIds includeMetaArray:(BOOL)includeMetaArray completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

messageId

The standard message ID to load messages.

limit

The limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If YES, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

senderUserIds

Returns messages whose sender user id matches sender user ids.

includeMetaArray

If YES, the messages has meta array.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Availability

3.0.116

Declared In

SBDBaseChannel.h

– getPreviousAndNextMessagesByMessageId:prevLimit:nextLimit:reverse:completionHandler:

Gets the previous and next message by the message ID with a limit and ordering. (Deprecated: in v3.0.40.)

- (void)getPreviousAndNextMessagesByMessageId:(long long)messageId prevLimit:(NSInteger)prevLimit nextLimit:(NSInteger)nextLimit reverse:(BOOL)reverse completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

messageId

The standard message ID to load messages.

prevLimit

The previous limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

nextLimit

The next limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Declared In

SBDBaseChannel.h

– getPreviousAndNextMessagesByMessageId:prevLimit:nextLimit:reverse:messageType:customType:completionHandler:

Gets the previous and next message by the message ID with a limit and ordering.

- (void)getPreviousAndNextMessagesByMessageId:(long long)messageId prevLimit:(NSInteger)prevLimit nextLimit:(NSInteger)nextLimit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

messageId

The standard message ID to load messages.

prevLimit

The previous limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

nextLimit

The next limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Declared In

SBDBaseChannel.h

– getPreviousAndNextMessagesByMessageId:prevLimit:nextLimit:reverse:messageType:customType:senderUserIds:completionHandler:

Gets the previous and next message by the message ID with a limit and ordering.

- (void)getPreviousAndNextMessagesByMessageId:(long long)messageId prevLimit:(NSInteger)prevLimit nextLimit:(NSInteger)nextLimit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType senderUserIds:(NSArray<NSString*> *_Nullable)senderUserIds completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

messageId

The standard message ID to load messages.

prevLimit

The previous limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

nextLimit

The next limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If yes, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

senderUserIds

Returns messages whose sender user id matches sender user ids.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Availability

3.0.106

Declared In

SBDBaseChannel.h

– getPreviousAndNextMessagesByMessageId:prevLimit:nextLimit:reverse:messageType:customType:senderUserIds:includeMetaArray:completionHandler:

Gets the previous and next message by the message ID with a limit and ordering.

- (void)getPreviousAndNextMessagesByMessageId:(long long)messageId prevLimit:(NSInteger)prevLimit nextLimit:(NSInteger)nextLimit reverse:(BOOL)reverse messageType:(SBDMessageTypeFilter)messageType customType:(NSString *_Nullable)customType senderUserIds:(NSArray<NSString*> *_Nullable)senderUserIds includeMetaArray:(BOOL)includeMetaArray completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable messages , SBDError *_Nullable error ))completionHandler

Parameters

messageId

The standard message ID to load messages.

prevLimit

The previous limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

nextLimit

The next limit for the number of messages. The returned messages could be more than this number if there are messages which have the same timestamp.

reverse

If YES, the latest message is the index 0.

messageType

Message type to filter messages.

customType

Custom type to filter messages. If filtering isn’t required, set nil.

senderUserIds

Returns messages whose sender user id matches sender user ids.

includeMetaArray

If YES, the messages has meta array.

completionHandler

The handler block to execute. The messages is the array of SBDBaseMessage instances.

Availability

3.0.116

Declared In

SBDBaseChannel.h

+ buildFromSerializedData:

Builds a base channel object from serialized data.

+ (nullable instancetype)buildFromSerializedData:(NSData *_Nonnull)data

Parameters

data

Serialized data.

Return Value

SBDBaseChannel object.

Declared In

SBDBaseChannel.h

– serialize

Serializes base channel object.

- (nullable NSData *)serialize

Return Value

Serialized data.

Declared In

SBDBaseChannel.h

+ cancelUploadingFileMessageWithRequestId:completionHandler:

Cancels the file message uploading.

+ (void)cancelUploadingFileMessageWithRequestId:(NSString *_Nonnull)requestId completionHandler:(nullable void ( ^ ) ( BOOL result , SBDError *_Nullable error ))completionHandler

Parameters

requestId

The request ID of the file message that is been uploading.

completionHandler

The handler block to execute. If the result is YES, then the uploading task of the requestId has been cancelled.

Declared In

SBDBaseChannel.h

– copyUserMessage:toTargetChannel:completionHandler:

Copies a user message to the target channel.

- (nonnull SBDUserMessage *)copyUserMessage:(SBDUserMessage *_Nonnull)message toTargetChannel:(SBDBaseChannel *_Nonnull)targetChannel completionHandler:(nullable void ( ^ ) ( SBDUserMessage *_Nullable userMessage , SBDError *_Nullable error ))completionHandler

Parameters

message

User message object.

targetChannel

Target channel object.

completionHandler

The handler block to execute. The userMessage is a user message which is returned from the SendBird server. The message has a message ID.

Return Value

Returns the temporary user message with a request ID. It doesn’t have a message ID.

Declared In

SBDBaseChannel.h

– copyFileMessage:toTargetChannel:completionHandler:

Copies a file message to the target channel.

- (nonnull SBDFileMessage *)copyFileMessage:(SBDFileMessage *_Nonnull)message toTargetChannel:(SBDBaseChannel *_Nonnull)targetChannel completionHandler:(nullable void ( ^ ) ( SBDFileMessage *_Nullable fileMessage , SBDError *_Nullable error ))completionHandler

Parameters

message

File message object.

targetChannel

Target channel object.

completionHandler

The handler block to execute. The fileMessage is a user message which is returned from the SendBird server. The message has a message ID.

Return Value

Returns the temporary file message with a request ID. It doesn’t have a message ID.

Declared In

SBDBaseChannel.h

– getMessageChangeLogsWithToken:completionHandler:

Gets the changelogs of the messages with token.

- (void)getMessageChangeLogsWithToken:(NSString *_Nullable)token completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable updatedMessages , NSArray<NSNumber*> *_Nullable deletedMessageIds , BOOL hasMore , NSString *_Nullable token , SBDError *_Nullable error ))completionHandler

Parameters

token

The token that is used to get more changelogs.

completionHandler

The handler block to execute. The updatedMessages is the messages that were updated. The deletedMessageIds is the list of the deleted message IDs. If there are more changelogs that are not returned yet, the hasMore is YES. The token can be used to get more changedlogs.

Declared In

SBDBaseChannel.h

– getMessageChangeLogsWithToken:includeMetaArray:completionHandler:

Gets the changelogs of the messages with token and meta array

- (void)getMessageChangeLogsWithToken:(NSString *_Nullable)token includeMetaArray:(BOOL)includeMetaArray completionHandler:(nullable void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable updatedMessages , NSArray<NSNumber*> *_Nullable deletedMessageIds , BOOL hasMore , NSString *_Nullable token , SBDError *_Nullable error ))completionHandler

Parameters

token

The token that is used to get more changelogs.

includeMetaArray

If YES, the updatedMessages has meta array.

completionHandler

The handler block to execute. The updatedMessages is the messages that were updated. The deletedMessageIds is the list of the deleted message IDs. If there are more changelogs that are not returned yet, the hasMore is YES. The token can be used to get more changedlogs.

Availability

3.0.116

Declared In

SBDBaseChannel.h

– getMessageChangeLogsByTimestamp:completionHandler:

Requests updated messages and deleted message IDs by the timestamp in this channel.

- (void)getMessageChangeLogsByTimestamp:(long long)timestamp completionHandler:(nonnull void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable updatedMessages , NSArray<NSNumber*> *_Nullable deletedMessageIds , BOOL hasMore , NSString *_Nullable token , SBDError *_Nullable error ))completionHandler

Parameters

timestamp

The number of milli-seconds(msec). Requests changelogs by that time. This value must not be negative.

completionHandler

The handler block to execute. The updatedMessages is the messages that were updated. The deletedMessageIds is the list of the deleted message IDs. If there are more changelogs, but doesn’t returned, then the hasMore is YES. The token can be used to get next more changedlogs.

Availability

3.0.122

Declared In

SBDBaseChannel.h

– getMessageChangeLogsByTimestamp:includeMetaArray:completionHandler:

Requests updated messages contains metaarray and deleted message IDs by the timestamp in this channel.

- (void)getMessageChangeLogsByTimestamp:(long long)timestamp includeMetaArray:(BOOL)includeMetaArray completionHandler:(nonnull void ( ^ ) ( NSArray<SBDBaseMessage*> *_Nullable updatedMessages , NSArray<NSNumber*> *_Nullable deletedMessageIds , BOOL hasMore , NSString *_Nullable token , SBDError *_Nullable error ))completionHandler

Parameters

timestamp

The number of milli-seconds(msec). Requests changelogs by that time. This value must not be negative.

includeMetaArray

If YES, the updatedMessages has meta array.

completionHandler

The handler block to execute. The updatedMessages is the messages that were updated. The deletedMessageIds is the list of the deleted message IDs. If there are more changelogs, but doesn’t returned, then the hasMore is YES. The token can be used to get next more changedlogs.

Availability

3.0.122

Declared In

SBDBaseChannel.h

– createMessageMetaArrayKeysWithMessage:keys:completionHandler:

Creates keys of meta array for the message.

- (void)createMessageMetaArrayKeysWithMessage:(nonnull SBDBaseMessage *)message keys:(nonnull NSArray<NSString*> *)keys completionHandler:(nullable void ( ^ ) ( SBDBaseMessage *_Nullable message , SBDError *_Nullable error ))completionHandler

Parameters

message

The message object. This method creates keys in it.

keys

Keys of meta array.

completionHandler

The handler block to execute. The message is a base message object that has the keys for its meta array.

Availability

3.0.116

Declared In

SBDBaseChannel.h

– deleteMessageMetaArrayKeysWithMessage:keys:completionHandler:

Deletes keys from meta array of the message.

- (void)deleteMessageMetaArrayKeysWithMessage:(nonnull SBDBaseMessage *)message keys:(nonnull NSArray<NSString*> *)keys completionHandler:(nullable void ( ^ ) ( SBDBaseMessage *_Nullable message , SBDError *_Nullable error ))completionHandler

Parameters

message

The message object. This method deletes keys of meta array of it.

keys

Keys to be deleted.

completionHandler

The handler block to execute.

Availability

3.0.116

Declared In

SBDBaseChannel.h

– addMessageMetaArrayValuesWithMessage:keyValues:completionHandler:

Adds meta array to the message.

- (void)addMessageMetaArrayValuesWithMessage:(nonnull SBDBaseMessage *)message keyValues:(nonnull NSDictionary<NSString*,NSArray<NSString*> *> *)keyValues completionHandler:(nullable void ( ^ ) ( SBDBaseMessage *_Nullable message , SBDError *_Nullable error ))completionHandler

Parameters

message

The message object. This method adds pairs of key and value to this message.

keyValues

Pairs of key-value to be added.

completionHandler

The handler block to execute.

Availability

3.0.116

Declared In

SBDBaseChannel.h

– addMessageMetaArrayValuesWithMessage:metaArrays:completionHandler:

Adds the array of meta array into the message.

- (void)addMessageMetaArrayValuesWithMessage:(nonnull SBDBaseMessage *)message metaArrays:(nonnull NSArray<SBDMessageMetaArray*> *)metaArrays completionHandler:(nullable SBDBaseMessageHandler)completionHandler

Parameters

message

The message instance. The metaArrays will added into the message.

metaArrays

An array of message meta array will be added into the message. the string of the value in the metaArray MUST NOT exist with same key.

completionHandler

The handler block to execute after adding message meta arrays. The message of the handler is updated message. If failed to add message meta arrays, the error of the handler is not nil(null).

Availability

3.0.148

Discussion

The metaArrays are upserted into the message. If a key in the metaArrays is new, the key will be inserted with the value. If a key in the metaArrays is already created, the value of the messageMetaArray will be inserted so strings in the value MUST be new one. @code SBDGroupChannel channel; SBDUserMessageParams params = [[SBDUserMessageParams alloc] initWithMessage:message]; params.metaArrayKeys = key_array; [channel sendUserMessageWithParams:params completionHandler:^(SBDUserMessage * Nullable message, SBDError * Nullable error) { // message has metaArrays

NSArraySBDMessageMetaArray > metaArrays = adding_meta_arrays; [channel addMessageMetaArrayValuesWithMessage:message metaArrays:metaArrays completionHandler:^(SBDBaseMessage * Nullable message, SBDError * Nullable error) { // added metaArrays into the message. }]; }]; @endcode

Declared In

SBDBaseChannel.h

– removeMessageMetaArrayValuesWithMessage:keyValues:completionHandler:

Removes meta array from the message.

- (void)removeMessageMetaArrayValuesWithMessage:(nonnull SBDBaseMessage *)message keyValues:(nonnull NSDictionary<NSString*,NSArray<NSString*> *> *)keyValues completionHandler:(nullable void ( ^ ) ( SBDBaseMessage *_Nullable message , SBDError *_Nullable error ))completionHandler

Parameters

message

The message object. This method removes pairs of key and value from this message.

keyValues

Pairs of key-value to be removed.

completionHandler

The handler block to execute.

Availability

3.0.116

Declared In

SBDBaseChannel.h

– removeMessageMetaArrayValuesWithMessage:metaArrays:completionHandler:

Removes the array of meta array from the message.

- (void)removeMessageMetaArrayValuesWithMessage:(nonnull SBDBaseMessage *)message metaArrays:(nonnull NSArray<SBDMessageMetaArray*> *)metaArrays completionHandler:(nullable SBDBaseMessageHandler)completionHandler

Parameters

message

The message instance. The metaArrays will removed from the message.

metaArrays

An array of message meta array will be removed from the message. the string of the value in the metaArray MUST exist with same key.

completionHandler

The handler block to execute after removing message meta arrays. The message of the handler is removed message. If failed to remove message meta arrays, the error of the handler is not nil(null).

Availability

3.0.148

Discussion

The metaArrays are removed from the message. If a key in the metaArrays has an emtpy array of the value, the key will be removed. If not, the value of the messageMetaArray will be removed from the message. The order of the meta array is guaranteed. @code SBDGroupChannel channel; SBDUserMessageParams params = [[SBDUserMessageParams alloc] initWithMessage:message]; params.metaArrayKeys = key_array; [channel sendUserMessageWithParams:params completionHandler:^(SBDUserMessage * Nullable message, SBDError * Nullable error) { // message has metaArrays

NSArraySBDMessageMetaArray > metaArrays = removing_meta_arrays; [channel removeMessageMetaArrayValuesWithMessage:message metaArrays:metaArrays completionHandler:^(SBDBaseMessage * Nullable message, SBDError * Nullable error) { // removed metaArrays into the message. }]; }]; @endcode

Declared In

SBDBaseChannel.h

– getMyMutedInfoWithCompletionHandler:

Gets the current user’s muted information in this channel.

- (void)getMyMutedInfoWithCompletionHandler:(nullable void ( ^ ) ( BOOL isMuted , NSString *_Nonnull description , long long startAt , long long endAt , long long remainingDuration , SBDError *_Nullable error ))completionHandler

Parameters

completionHandler

The handler block to be executed.

Availability

3.0.118

Declared In

SBDBaseChannel.h