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 *)text

Declared 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 *)metadata

Declared 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 *)metadata

Declared 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 *messageId

Declared In

KBMMessage.h

  text

The text content of the message. May be nil if mediaUrl or actions are provided

@property (nullable) NSString *text

Declared In

KBMMessage.h

  textFallback

The text fallback to display for message types not supported by the SDK. May be nil

@property (nullable) NSString *textFallback

Declared In

KBMMessage.h

  displayName

The displayName of the author. This property may be nil if no displayName could be determined.

@property (nullable) NSString *displayName

Declared In

KBMMessage.h

  avatarUrl

The url for the author’s avatar image. May be nil

@property (nullable) NSString *avatarUrl

Declared In

KBMMessage.h

  date

The date and time the message was sent

@property (nullable) NSDate *date

Declared 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 isFromCurrentUser

Declared In

KBMMessage.h

  uploadStatus

The upload status of the message.

@property (readonly) KBMMessageUploadStatus uploadStatus

Declared In

KBMMessage.h

  actions

An array of KBMMessageAction objects representing the actions associated with this message (if any)

@property (readonly, nullable) NSArray *actions

Discussion

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 *items

Discussion

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 *mediaUrl

Declared In

KBMMessage.h

  mediaSize

The size of the media asset in bytes. May be nil.

@property (nullable) NSNumber *mediaSize

Declared In

KBMMessage.h

  type

The type the message.

@property (nullable) NSString *type

Discussion

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 *coordinates

Declared In

KBMMessage.h

  displaySettings

Settings to adjust the layout of a message of type KBMMessageTypeCarousel

@property (readonly, nullable) KBMDisplaySettings *displaySettings

Declared In

KBMMessage.h

  role

The role of the message.

@property (readonly, nullable) NSString *role

Discussion

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 *metadata

Discussion

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 *payload

Discussion

The payload of a KBMMessageActionTypeReply, if applicable. May be nil

Declared In

KBMMessage.h