SKTMessage Class Reference

Inherits from NSObject
Declared in SKTMessage.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

SKTMessage.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

SKTMessage.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 SKTCoordinates *)coordinates payload:(nullable NSString *)payload metadata:(nullable NSDictionary *)metadata

Declared In

SKTMessage.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

SKTMessage.h

  text

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

@property (nullable) NSString *text

Declared In

SKTMessage.h

  textFallback

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

@property (nullable) NSString *textFallback

Declared In

SKTMessage.h

  name

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

@property (nullable) NSString *name

Declared In

SKTMessage.h

  avatarUrl

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

@property (nullable) NSString *avatarUrl

Declared In

SKTMessage.h

  date

The date and time the message was sent

@property (nullable) NSDate *date

Declared In

SKTMessage.h

  isFromCurrentUser

Returns YES if the message originated from the user, or NO if the message comes from the app team.

@property (readonly) BOOL isFromCurrentUser

Declared In

SKTMessage.h

  uploadStatus

The upload status of the message.

@property (readonly) SKTMessageUploadStatus uploadStatus

Declared In

SKTMessage.h

  actions

An array of SKTMessageAction 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

SKTMessage.h

  items

An array of SKTMessageItem objects representing the items associated with this message

@property (readonly, nullable) NSArray *items

Discussion

Only messages of type SKTMessageTypeCarousel and SKTMessageTypeList contain items.

See Also

Declared In

SKTMessage.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

SKTMessage.h

  mediaSize

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

@property (nullable) NSNumber *mediaSize

Declared In

SKTMessage.h

  type

The type the message.

@property (nullable) NSString *type

Discussion

Valid types include SKTMessageTypeText, SKTMessageTypeImage, and SKTMessageTypeLocation

Declared In

SKTMessage.h

  coordinates

Coordinates for a location for a message of type SKTMessageTypeLocation

@property (readonly, nullable) SKTCoordinates *coordinates

Declared In

SKTMessage.h

  displaySettings

Settings to adjust the layout of a message of type SKTMessageTypeCarousel

@property (readonly, nullable) SKTDisplaySettings *displaySettings

Declared In

SKTMessage.h

  role

The role of the message.

@property (readonly, nullable) NSString *role

Discussion

Valid roles include appUser, appMaker, and whisper. Messages created with -initWithText: have role of appUser.

Declared In

SKTMessage.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

SKTMessage.h

  payload

The payload of an action with type SKTMessageActionTypeReply

@property (nullable) NSString *payload

Discussion

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

Declared In

SKTMessage.h