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 *)textDeclared 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 *)metadataDeclared 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 *)metadataDeclared 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 *messageIdDeclared In
OMCMessage.h
text
The text content of the message. May be nil if mediaUrl or actions are provided
@property (nullable) NSString *textDeclared In
OMCMessage.h
textFallback
The text fallback to display for message types not supported by the SDK. May be nil
@property (nullable) NSString *textFallbackDeclared In
OMCMessage.h
name
The name of the author. This property may be nil if no name could be determined.
@property (nullable) NSString *nameDeclared In
OMCMessage.h
avatarUrl
The url for the author’s avatar image. May be nil
@property (nullable) NSString *avatarUrlDeclared In
OMCMessage.h
date
The date and time the message was sent
@property (nullable) NSDate *dateDeclared 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 isFromCurrentUserDeclared In
OMCMessage.h
uploadStatus
The upload status of the message.
@property (readonly) OMCMessageUploadStatus uploadStatusDeclared In
OMCMessage.h
actions
An array of OMCMessageAction 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
OMCMessage.h
items
An array of OMCMessageItem objects representing the items associated with this message
@property (readonly, nullable) NSArray *itemsDiscussion
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 *mediaUrlDeclared In
OMCMessage.h
mediaSize
The size of the media asset in bytes. May be nil.
@property (nullable) NSNumber *mediaSizeDeclared In
OMCMessage.h
type
The type the message.
@property (nullable) NSString *typeDiscussion
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 *coordinatesDeclared In
OMCMessage.h
displaySettings
Settings to adjust the layout of a message of type OMCMessageTypeCarousel
@property (readonly, nullable) OMCDisplaySettings *displaySettingsSee Also
Declared In
OMCMessage.h
role
The role of the message.
@property (readonly, nullable) NSString *roleDiscussion
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 *metadataDiscussion
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 *payloadDiscussion
The payload of a OMCMessageActionTypeReply, if applicable. May be nil
Declared In
OMCMessage.h