TCHMessage Class Reference
| Inherits from | NSObject | 
|---|---|
| Declared in | TCHMessage.h | 
  sid
	The unique identifier for this message.
@property (nonatomic, copy, readonly, nullable) NSString *sidDiscussion
The unique identifier for this message.
Declared In
TCHMessage.h
  index
	Index of Message in the Conversation’s messages stream.
@property (nonatomic, copy, readonly, nullable) NSNumber *indexDiscussion
Index of Message in the Conversation’s messages stream.
By design of the conversations system the message indices may have arbitrary gaps between them, that does not necessarily mean they were deleted or otherwise modified - just that messages may have non-contiguous indices even if they are sent immediately one after another.
Trying to use indices for some calculations is going to be unreliable.
To calculate the number of unread messages it is better to use the read horizon API. See [TCHConversation getUnreadMessagesCountWithCompletion:] for details.
Declared In
TCHMessage.h
  author
	The identity of the author of the message.
@property (nonatomic, copy, readonly, nullable) NSString *authorDiscussion
The identity of the author of the message.
Declared In
TCHMessage.h
  subject
	The subject of the message.
@property (nonatomic, copy, readonly, nullable) NSString *subjectDiscussion
The subject of the message.
Declared In
TCHMessage.h
  body
	The body of the message.
@property (nonatomic, copy, readonly, nullable) NSString *bodyDiscussion
The body of the message.
For an email the body will contain the preview for the email.
To get full email body call getEmailBodyForContentType
Declared In
TCHMessage.h
  participantSid
	The SID of the participant this message is sent by.
@property (nonatomic, copy, readonly, nullable) NSString *participantSidDiscussion
The SID of the participant this message is sent by.
Declared In
TCHMessage.h
  participant
	The participant this message is sent by.
@property (nonatomic, copy, readonly, nullable) TCHParticipant *participantDiscussion
The participant this message is sent by.
Declared In
TCHMessage.h
  dateCreated
	The message creation date.
@property (nonatomic, copy, readonly, nullable) NSString *dateCreatedDiscussion
The message creation date.
Declared In
TCHMessage.h
  dateCreatedAsDate
	The message creation date as an NSDate.
@property (nonatomic, strong, readonly, nullable) NSDate *dateCreatedAsDateDiscussion
The message creation date as an NSDate.
Declared In
TCHMessage.h
  dateUpdated
	The message last update date.
@property (nonatomic, copy, readonly, nullable) NSString *dateUpdatedDiscussion
The message last update date.
Declared In
TCHMessage.h
  dateUpdatedAsDate
	The message last update date as an NSDate.
@property (nonatomic, strong, readonly, nullable) NSDate *dateUpdatedAsDateDiscussion
The message last update date as an NSDate.
Declared In
TCHMessage.h
  lastUpdatedBy
	The identity of the user who updated the message.
@property (nonatomic, copy, readonly, nullable) NSString *lastUpdatedByDiscussion
The identity of the user who updated the message.
Declared In
TCHMessage.h
  aggregatedDeliveryReceipt
	Aggregated delivery receipt for the message.
@property (readonly, nullable) TCHAggregatedDeliveryReceipt *aggregatedDeliveryReceiptDiscussion
Aggregated delivery receipt for the message.
Declared In
TCHMessage.h
  attachedMedia
	All media attachments (not including email body/history attachments).
@property (readonly, nonnull) NSArray<TCHMedia*> *attachedMediaDiscussion
All media attachments (not including email body/history attachments).
Declared In
TCHMessage.h
– getDetailedDeliveryReceiptsWithCompletion:
	Get detailed delivery receipts for the message.
- (void)getDetailedDeliveryReceiptsWithCompletion:(nonnull TCHDetailedDeliveryReceiptsCompletion)completionParameters
| completion | Completion block that will specify the result of the operation. | 
|---|
Discussion
Get detailed delivery receipts for the message.
Declared In
TCHMessage.h
– updateBody:completion:
	Update the body of this message
- (void)updateBody:(nonnull NSString *)body completion:(nullable TCHCompletion)completionParameters
| body | The new body for this message. | 
|---|---|
| completion | Completion block that will specify the result of the operation. | 
Discussion
Update the body of this message
Declared In
TCHMessage.h
– attributes
	Return this message’s attributes.
- (nullable TCHJsonAttributes *)attributesReturn Value
The developer-defined extensible attributes for this message.
Discussion
Return this message’s attributes.
Declared In
TCHMessage.h
– setAttributes:completion:
	Set this message’s attributes.
- (void)setAttributes:(nullable TCHJsonAttributes *)attributes completion:(nullable TCHCompletion)completionParameters
| attributes | The new developer-defined extensible attributes for this message. (Supported types are NSString, NSNumber, NSArray, NSDictionary and NSNull) | 
|---|---|
| completion | Completion block that will specify the result of the operation. | 
Discussion
Set this message’s attributes.
Declared In
TCHMessage.h
– getContentDataWithCompletion:
	Download the content data for the message.
- (void)getContentDataWithCompletion:(nonnull TCHContentDataCompletion)completionParameters
| completion | Completion block that will specify the result of the operation. | 
|---|
Discussion
Download the content data for the message.
See [TCHContentDataType] for the list of available content data types and corresponding data classes.
Declared In
TCHMessage.h
– getMediaByCategories:
	Return a list of media matching the specific set of categories.
- (nonnull NSArray<TCHMedia*> *)getMediaByCategories:(nonnull NSSet<NSNumber*> *)categoriesParameters
| categories | The set of categories to match. | 
|---|
Return Value
The list of media descriptors matching given categories.
Discussion
Return a list of media matching the specific set of categories.
Declared In
TCHMessage.h
– getEmailBody
	Returns the email body attachment of the default text/plain content type.
- (nullable TCHMedia *)getEmailBodyReturn Value
The email body attachment or nil if message has no email body for the requested content type.
Discussion
Returns the email body attachment of the default text/plain content type.
Declared In
TCHMessage.h
– getEmailBodyForContentType:
	Returns the email body attachment of the specific content type.
- (nullable TCHMedia *)getEmailBodyForContentType:(nonnull NSString *)contentTypeParameters
| contentType | The type to match. | 
|---|
Return Value
The email body attachment or nil if message has no email body for the requested content type.
Discussion
Returns the email body attachment of the specific content type.
Declared In
TCHMessage.h
– getEmailHistory
	Returns the email history attachment of the default text/plain content type.
- (nullable TCHMedia *)getEmailHistoryReturn Value
The email history attachment or nil if message has no email history for the requested content type.
Discussion
Returns the email history attachment of the default text/plain content type.
Declared In
TCHMessage.h
– getEmailHistoryForContentType:
	Returns the email history attachment of the specific content type.
- (nullable TCHMedia *)getEmailHistoryForContentType:(nonnull NSString *)contentTypeParameters
| contentType | The type to match. | 
|---|
Return Value
The email history attachment or nil if message has no email history for the requested content type.
Discussion
Returns the email history attachment of the specific content type.
Declared In
TCHMessage.h
– getTemporaryContentUrlsForAttachedMediaWithCompletion:
	Get content URLs for all attached media using a single network request.
- (nullable TCHCancellationToken *)getTemporaryContentUrlsForAttachedMediaWithCompletion:(nonnull TCHMediaSidsCompletion)completionParameters
| completion | The listener to receive a map of media sids to content temporary URL. | 
|---|
Return Value
The cancellation token to cancel the network request.
Discussion
Get content URLs for all attached media using a single network request.
The returned URLs are impermanent, they will expire in several minutes and thus cannot be cached. If the URLs expire, you will need to request new ones. Each call to this function produces new temporary URLs.
Declared In
TCHMessage.h
– getTemporaryContentUrlsForMedia:completion:
	Get content URLs for all media attachments in the given set using a single network request.
- (nullable TCHCancellationToken *)getTemporaryContentUrlsForMedia:(nonnull NSSet<TCHMedia*> *)media completion:(nonnull TCHMediaSidsCompletion)completionParameters
| media | The set of media objects to query content URLs for. | 
|---|---|
| completion | The completion block to receive a map of media sids to corresponding temporary content URLs. | 
Return Value
The cancellation token to cancel the network request.
Discussion
Get content URLs for all media attachments in the given set using a single network request.
This is a convenience method, see [TwilioConversationsClient getTemporaryContentUrlsForMedia:completion:]
The returned URLs are impermanent, they will expire in several minutes and thus cannot be cached. If the URLs expire, you will need to request new ones. Each call to this function produces new temporary URLs.
Declared In
TCHMessage.h
– getTemporaryContentUrlsForMediaSids:completion:
	Get content URLs for all media attachments in the given set using a single network request.
- (nullable TCHCancellationToken *)getTemporaryContentUrlsForMediaSids:(nonnull NSSet<NSString*> *)sids completion:(nonnull TCHMediaSidsCompletion)completionParameters
| sids | The set of media sids to query content URLs for. | 
|---|---|
| completion | The completion block to receive a map of media sids to corresponding temporary content URLs. | 
Return Value
The cancellation token to cancel the network request.
Discussion
Get content URLs for all media attachments in the given set using a single network request.
This is a convenience method, see [TwilioConversationsClient getTemporaryContentUrlsForMediaSids:completion:]
The returned URLs are impermanent, they will expire in several minutes and thus cannot be cached. If the URLs expire, you will need to request new ones. Each call to this function produces new temporary URLs.
Declared In
TCHMessage.h