KBMMessage Class Reference
| Inherits from | NSObject |
|---|---|
| Conforms to | NSSecureCoding |
| Declared in | KBMMessage.h |
– initWithText:
Create a message with the given text. The message will be owned by the current user.
- (nonnull instancetype)initWithText:(nonnull NSString *)textDeclared In
KBMMessage.h
– initWithText:payload:metadata:
Create a message with the given text, payload, and metadata. The message will be owned by the current user
- (nonnull instancetype)initWithText:(nonnull NSString *)text payload:(nullable NSString *)payload metadata:(nullable NSDictionary *)metadataDeclared In
KBMMessage.h
– initWithCoordinates:payload:metadata:
Create a message with the given coordinates, payload, and metadata. The message will be owned by the current user
- (nonnull instancetype)initWithCoordinates:(nonnull KBMCoordinates *)coordinates payload:(nullable NSString *)payload metadata:(nullable NSDictionary *)metadataDeclared In
KBMMessage.h
messageId
The unique identifier of the message. May be nil if a unique identifier has not been generated for this message
@property (readonly, nullable) NSString *messageIdDeclared In
KBMMessage.h
text
The text content of the message. May be nil if mediaUrl or actions are provided
@property (nullable) NSString *textDeclared In
KBMMessage.h
textFallback
The text fallback to display for message types not supported by the SDK. May be nil
@property (nullable) NSString *textFallbackDeclared In
KBMMessage.h
displayName
The displayName of the author. This property may be nil if no displayName could be determined.
@property (nullable) NSString *displayNameDeclared In
KBMMessage.h
avatarUrl
The url for the author’s avatar image. May be nil
@property (nullable) NSString *avatarUrlDeclared In
KBMMessage.h
date
The date and time the message was sent
@property (nullable) NSDate *dateDeclared In
KBMMessage.h
isFromCurrentUser
Returns YES if the message originated from the user, or NO if the message comes from the app team.
@property (nonatomic) BOOL isFromCurrentUserDeclared In
KBMMessage.h
uploadStatus
The upload status of the message.
@property (readonly) KBMMessageUploadStatus uploadStatusDeclared In
KBMMessage.h
actions
An array of KBMMessageAction objects representing the actions associated with this message (if any)
@property (readonly, nullable) NSArray *actionsDiscussion
This array may be nil or empty, so check the length of the array to know if a message has actions or not.
See Also
Declared In
KBMMessage.h
items
An array of KBMMessageItem objects representing the items associated with this message
@property (readonly, nullable) NSArray *itemsDiscussion
Only messages of type KBMMessageTypeCarousel and KBMMessageTypeList contain items.
See Also
Declared In
KBMMessage.h
mediaUrl
The url to the media asset, if applicable. Returns nil if the message is not an image or file message.
@property (nullable) NSString *mediaUrlDeclared In
KBMMessage.h
mediaSize
The size of the media asset in bytes. May be nil.
@property (nullable) NSNumber *mediaSizeDeclared In
KBMMessage.h
type
The type the message.
@property (nullable) NSString *typeDiscussion
Valid types include KBMMessageTypeText, KBMMessageTypeImage, and KBMMessageTypeLocation
Declared In
KBMMessage.h
coordinates
Coordinates for a location for a message of type KBMMessageTypeLocation
@property (readonly, nullable) KBMCoordinates *coordinatesDeclared In
KBMMessage.h
displaySettings
Settings to adjust the layout of a message of type KBMMessageTypeCarousel
@property (readonly, nullable) KBMDisplaySettings *displaySettingsSee Also
Declared In
KBMMessage.h
role
The role of the message.
@property (readonly, nullable) NSString *roleDiscussion
Valid roles include appUser, business, and whisper. Messages created with -initWithText: have role of appUser.
Declared In
KBMMessage.h
metadata
Metadata associated with the message.
@property (nullable) NSDictionary *metadataDiscussion
A flat dictionary of metadata set through the REST API. May be nil.
Declared In
KBMMessage.h
payload
The payload of an action with type KBMMessageActionTypeReply
@property (nullable) NSString *payloadDiscussion
The payload of a KBMMessageActionTypeReply, if applicable. May be nil
Declared In
KBMMessage.h