OMCMessage Class Reference
Inherits from | NSObject |
---|---|
Declared in | OMCMessage.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
OMCMessage.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
OMCMessage.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 OMCCoordinates *)coordinates payload:(nullable NSString *)payload metadata:(nullable NSDictionary *)metadata
Declared In
OMCMessage.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
OMCMessage.h
text
The text content of the message. May be nil if mediaUrl or actions are provided
@property (nullable) NSString *text
Declared In
OMCMessage.h
textFallback
The text fallback to display for message types not supported by the SDK. May be nil
@property (nullable) NSString *textFallback
Declared In
OMCMessage.h
name
The name of the author. This property may be nil if no name could be determined.
@property (nullable) NSString *name
Declared In
OMCMessage.h
avatarUrl
The url for the author’s avatar image. May be nil
@property (nullable) NSString *avatarUrl
Declared In
OMCMessage.h
date
The date and time the message was sent
@property (nullable) NSDate *date
Declared In
OMCMessage.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
OMCMessage.h
uploadStatus
The upload status of the message.
@property (readonly) OMCMessageUploadStatus uploadStatus
Declared In
OMCMessage.h
actions
An array of OMCMessageAction 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
OMCMessage.h
items
An array of OMCMessageItem objects representing the items associated with this message
@property (readonly, nullable) NSArray *items
Discussion
Only messages of type OMCMessageTypeCarousel
and OMCMessageTypeList
contain items.
See Also
Declared In
OMCMessage.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
OMCMessage.h
mediaSize
The size of the media asset in bytes. May be nil.
@property (nullable) NSNumber *mediaSize
Declared In
OMCMessage.h
type
The type the message.
@property (nullable) NSString *type
Discussion
Valid types include OMCMessageTypeText, OMCMessageTypeImage, and OMCMessageTypeLocation
Declared In
OMCMessage.h
coordinates
Coordinates for a location for a message of type OMCMessageTypeLocation
@property (readonly, nullable) OMCCoordinates *coordinates
Declared In
OMCMessage.h
displaySettings
Settings to adjust the layout of a message of type OMCMessageTypeCarousel
@property (readonly, nullable) OMCDisplaySettings *displaySettings
See Also
Declared In
OMCMessage.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
OMCMessage.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
OMCMessage.h
payload
The payload of an action with type OMCMessageActionTypeReply
@property (nullable) NSString *payload
Discussion
The payload of a OMCMessageActionTypeReply, if applicable. May be nil
Declared In
OMCMessage.h