SBDBaseMessage Class Reference
| Inherits from | NSObject |
|---|---|
| Conforms to | NSCopying SBDMappable |
| Declared in | SBDBaseMessage.h |
Overview
The SBDBaseMessage class represents the base message which is generated by a user or an admin.
The SBDUserMessage, the SBDFileMessage and the SBDAdminMessage are derived from this class.
requestId
Request ID for checking ACK.
@property (strong, nonatomic, readonly) NSString *requestIdDeclared In
SBDBaseMessage.h
message
Message text.
@property (strong, nonatomic, readonly) NSString *messageDeclared In
SBDBaseMessage.h
sendingStatus
Represents the dispatch state of the message.
If message is not dispatched completely to the Sendbird server, the value is SBDMessageSendingStatusPending.
If failed to send the message, the value is SBDMessageSendingStatusFailed.
And if success to send the message, the value is SBDMessageSendingStatusSucceeded.
@property (assign, nonatomic, readonly) SBDMessageSendingStatus sendingStatusAvailability
3.0.173
Declared In
SBDBaseMessage.h
sender
Sender of the message. This is represented by SBDSender class.
@property (strong, nonatomic, nullable) SBDSender *senderDeclared In
SBDBaseMessage.h
channelUrl
Channel URL which has this message.
@property (strong, nonatomic) NSString *channelUrlDeclared In
SBDBaseMessage.h
channelType
Channel type of this message.
@property (strong, nonatomic) NSString *channelTypeDeclared In
SBDBaseMessage.h
mentionedUsers
The list of users who was mentioned together with the message.
@property (strong, nonatomic, readonly) NSArray<SBDUser*> *mentionedUsersAvailability
3.0.90
Declared In
SBDBaseMessage.h
mentionType
3.0.103
@property (atomic, readonly) SBDMentionType mentionTypeAvailability
3.0.103
Declared In
SBDBaseMessage.h
requestedMentionUserIds
Represents target user ids to mention when success to send the message.
This value is valid only when the message is a pending message or failed message.
If the message is a succeeded message, see mentionedUserIds
@property (strong, nonatomic, readonly) NSArray<NSString*> *requestedMentionUserIdsAvailability
3.0.147
See Also
see
mentionedUserIdswhen the @property message is a succeeded @property message.
Declared In
SBDBaseMessage.h
createdAt
Message created time in millisecond(UTC).
@property (atomic) long long createdAtDeclared In
SBDBaseMessage.h
updatedAt
Message updated time in millisecond(UTC).
@property (atomic) long long updatedAtDeclared In
SBDBaseMessage.h
parentMessageId
The unique ID of the parent message. If the message object is a parent message or a single message without any reply, the value of this property is 0. If the object is a reply, the value is the unique ID of its parent message.
@property (atomic, readonly) long long parentMessageIdAvailability
3.0.181
Discussion
Note: The default value is 0.
Declared In
SBDBaseMessage.h
parentMessageText
The written text of the message object’s parent message. If the message object is a parent message, the value of this property is nil. If the object is a reply to a parent message and the type of the parent message is SBDUserMessage, the value is message. If it is SBDFileMessage, the value is the name of the uploaded file. (Deprecated: 3.0.236 (Use parentMessageInfo instead.))
@property (strong, readonly, nullable) NSString *parentMessageTextAvailability
3.0.181
Declared In
SBDBaseMessage.h
threadInfo
The thread info that belongs to this message object.
@property (strong, readonly) SBDThreadInfo *threadInfoAvailability
3.0.181
Declared In
SBDBaseMessage.h
metaArray
d 3.0.148. (Use metaArrays instead.) (Deprecated: 3.0.148. (Use metaArrays instead.))
@property (nonatomic, readonly, getter=getAllMetaArray) NSDictionary<NSString*NSArray<NSString*> *> *metaArrayAvailability
3.0.116
Declared In
SBDBaseMessage.h
metaArrays
3.0.148
@property (strong, nonatomic, readonly, nullable) NSArray<SBDMessageMetaArray*> *metaArraysAvailability
3.0.148
Declared In
SBDBaseMessage.h
data
The custom data for message.
@property (strong, nonatomic, readonly) NSString *dataDeclared In
SBDBaseMessage.h
customType
Custom message type.
@property (strong, nonatomic, readonly, nullable) NSString *customTypeDeclared In
SBDBaseMessage.h
reactions
@property (strong, nonatomic, readonly, getter=getReactions) NSArray<SBDReaction*> *reactions errorCode
The error code of file. This value generated only when message send fails.
@property (assign, nonatomic, readonly) NSUInteger errorCodeAvailability
3.0.161
Declared In
SBDBaseMessage.h
ogMetaData
Optional open graph information if the message contains links. We only support first open graph tag appearance on the first link
@property (nonatomic, strong, readonly, nullable) SBDOGMetaData *ogMetaDataAvailability
3.0.193
Declared In
SBDBaseMessage.h
plugins
List of plugin that are corresponding to this message
@property (nonatomic, strong, readonly, nullable) NSArray<SBDPlugin*> *pluginsAvailability
3.0.207
Declared In
SBDBaseMessage.h
isOperatorMessage
Represents whether this message was created by an operator.
@property (atomic, readonly) BOOL isOperatorMessageAvailability
3.0.198
Declared In
SBDBaseMessage.h
messageParams
An object that was used to resend this message. This property is valid when the sendingStatus is SBDMessageSendingStatusPending or SBDMessageSendingStatusFailed. When this message is trying to be resent, this property will be used as well. If the message object is SBDUserMessage class, then the messageParams has to be casted to SBDUserMessageParams class. If the message object is SBDFileMessage class, then the messageParams has to be casted to SBDFileMessageParams class.
@property (strong, nonatomic, nullable) SBDBaseMessageParams *messageParamsAvailability
3.1.0
Declared In
SBDBaseMessage.h
parentMessage
Current message’s parent message object.
When parentMessage is SBDUserMessage
it only has 3 properties:
- NSString message
- SBDSender sender
- long long createdAt
When parentMessage is SBDAdminMessage
it only has 3 properties:
- NSString message
- SBDSender sender
- long long createdAt
When parentMessage is SBDFileMessage
it only has 6 properties:
- NSString message
- SBDSender sender
- long long createdAt
- NSString name
- NSString url
- NSString type
@property (atomic, nullable) SBDBaseMessage *parentMessageAvailability
3.0.236
Declared In
SBDBaseMessage.h
isReplyToChannel
Determines whether current message is also shown on channel.
@property (atomic) BOOL isReplyToChannelAvailability
3.0.236
Declared In
SBDBaseMessage.h
mentionedMessageTemplate
The template for the message that has the mentioned users.
@property (strong, readonly, nullable) NSString *mentionedMessageTemplateAvailability
3.1.11
Declared In
SBDBaseMessage.h
– isOpenChannel
Returns YES, when this is open channel.
- (BOOL)isOpenChannelReturn Value
Returns YES, when this is open channel.
Declared In
SBDBaseMessage.h
– isGroupChannel
Returns YES, when this is group channel.
- (BOOL)isGroupChannelReturn Value
Returns YES, when this is group channel.
Declared In
SBDBaseMessage.h
+ buildFromSerializedData:
Serialized data.
+ (nullable instancetype)buildFromSerializedData:(NSData *_Nonnull)dataParameters
data |
Serialized data. |
|---|
Return Value
SBDBaseMessage object.
Declared In
SBDBaseMessage.h
+ buildFromSerializedData:desiredState:
Serialized data.
+ (nullable instancetype)buildFromSerializedData:(NSData *_Nonnull)data desiredState:(SBDMessageSendingStatus)desiredStateParameters
data |
Serialized data. |
|---|---|
desiredState |
The sending status that a message object will have. |
Return Value
SBDBaseMessage object.
Availability
3.0.203
Declared In
SBDBaseMessage.h
– serialize
Serialized data.
- (nullable NSData *)serializeReturn Value
Serialized data.
Declared In
SBDBaseMessage.h
– getMetaArrayWithKeys:
d 3.0.148 (Deprecated: 3.0.148)
- (NSDictionary<NSString*,NSArray<NSString*> *> *)getMetaArrayWithKeys:(NSArray<NSString*> *_Nonnull)keysParameters
keys |
Keys of the meta array. |
|---|
Return Value
Meta array of the keys.
Availability
3.0.116
See Also
Declared In
SBDBaseMessage.h
– metaArraysWithKeys:
@code
NSArray
- (NSArray<SBDMessageMetaArray*> *)metaArraysWithKeys:(nonnull NSArray<NSString*> *)keysDeclared In
SBDBaseMessage.h
+ getMessageWithParams:completionHandler:
+ (void)getMessageWithParams:(nonnull SBDMessageRetrievalParams *)params completionHandler:(nullable void ( ^ ) ( SBDBaseMessage *_Nullable message , SBDError *_Nullable error ))completionHandlerParameters
params |
Contains a set of parameters you can set regarding the messages in the results. |
|---|---|
completionHandler |
The handler block to be executed. The |
Availability
3.0.181
Declared In
SBDBaseMessage.h
– getThreadedMessagesByTimestamp:params:completionHandler:
Retrieves the threaded replies of the current message depending on the timestamp. If the current message doesn’t have replies, the result is nil.
- (void)getThreadedMessagesByTimestamp:(long long)timestamp params:(nonnull SBDThreadedMessageListParams *)params completionHandler:(nullable void ( ^ ) ( SBDBaseMessage *_Nullable parentMessage , NSArray<SBDBaseMessage*> *_Nullable threadedReplies , SBDError *_Nullable error ))completionHandlerParameters
timestamp |
Specifies the timestamp to be the reference point of the retrieval, in Unix milliseconds format. |
|---|---|
params |
Contains a set of parameters you can set regarding the messages in the results. |
completionHandler |
The handler block to be executed. The |
Availability
3.0.181
Declared In
SBDBaseMessage.h
– applyThreadInfoUpdateEvent:
Applies the update of the thread information to the message object. This method has to be called when the
channel:didUpdateThreadInfo:
event returns the SBDThreadInfoUpdateEvent object.
- (BOOL)applyThreadInfoUpdateEvent:(nonnull SBDThreadInfoUpdateEvent *)threadInfoUpdateEventParameters
threadInfoUpdateEvent |
The event object that is applied to. |
|---|
Return Value
Returns If the threadInfoUpdateEvent parameter is nil or the targetMessageId included in the parameter doesn’t match any message, this method returns NO.
Availability
3.0.181
Declared In
SBDBaseMessage.h
– applyParentMessage:
Applies the message to the current message object as a parent message.
If the parentMessageId is different with the message ID of the parentMessage, then NO will be returned.
- (BOOL)applyParentMessage:(nonnull SBDBaseMessage *)parentMessageParameters
parentMessage |
The parent message object to be updated. |
|---|
Availability
3.1.3
Declared In
SBDBaseMessage.h