TTMessageRequest Class Reference

Inherits from NSObject
Declared in TTMessageRequest.h

Overview

A TTMessageRequest object represents a new outgoing message to be sent using TTKit. TTMessageRequest encapsulates the recipient, message body, attachment, and metadata. To send a message in TTKit, pass a TTMessageRequest object to TTKit sendMessageWithRequest:completion: API.

  recipientToken

The message recipient token, required.

@property (nullable, nonatomic, readonly) NSString *recipientToken

Declared In

TTMessageRequest.h

  roleSenderToken

If set the message will be sent from a role, local user must opt-in to a role before sending a message as the role.

@property (nullable, nonatomic, readonly) NSString *roleSenderToken

Declared In

TTMessageRequest.h

  messageText

Message text.

@property (nullable, nonatomic) NSString *messageText

Declared In

TTMessageRequest.h

  timeToLive

Message time to live in minutes. Default is 30 days

@property (nonatomic) NSUInteger timeToLive

Declared In

TTMessageRequest.h

  deleteOnRead

Delete on read, sets message timeToLive to 60 seconds once the message is read.

@property (nonatomic) BOOL deleteOnRead

Declared In

TTMessageRequest.h

  messagePriority

Indicates the message priority. Default is TTMessagePriorityNormal

@property (nonatomic) TTMessagePriority messagePriority

Declared In

TTMessageRequest.h

  organizationToken

The organization token. Default is the current organization token

@property (nullable, nonatomic) NSString *organizationToken

Declared In

TTMessageRequest.h

  attachmentData

Attachment NSData, use setMessageAttachmentWithData:mimeType: to set your attachment data

@property (nullable, nonatomic, readonly) NSData *attachmentData

Declared In

TTMessageRequest.h

  attachmentFilePath

Attachment file path, use setMessageAttachmentWithFilePath: to set the file path to your attachment

@property (nullable, nonatomic, readonly) NSString *attachmentFilePath

Declared In

TTMessageRequest.h

  attachmentMimeType

Attachment mime type

@property (nullable, nonatomic, readonly) NSString *attachmentMimeType

Declared In

TTMessageRequest.h

  metadata

An Array of NSDictionaries representing message metadata in datum format (namespace, mimetype, payload). Use addMessageMetadata:mimeType:payload to add to this array

@property (nullable, nonatomic, readonly) NSArray *metadata

Declared In

TTMessageRequest.h

– initWithRecipientToken:

Initialize with recipient token.

- (instancetype _Nonnull)initWithRecipientToken:(NSString *_Nonnull)recipientToken

Parameters

recipientToken

The message recipient token.

Declared In

TTMessageRequest.h

– initWithRecipientToken:sendAsRole:

Initialize with recipient token.

- (instancetype _Nonnull)initWithRecipientToken:(NSString *_Nonnull)recipientToken sendAsRole:(TTRole *_Nullable)role

Parameters

recipientToken

The message recipient token.

role

The Role you wish to send the message from.

Declared In

TTMessageRequest.h

– setMessageAttachmentWithData:mimeType:

Set message attachment with data.

- (void)setMessageAttachmentWithData:(NSData *_Nonnull)data mimeType:(NSString *_Nonnull)mimeType

Parameters

data

Attachment data.

mimeType

Attachment mime type.

Declared In

TTMessageRequest.h

– setMessageAttachmentWithFilePath:mimeType:

Set message attachment with file path.

- (void)setMessageAttachmentWithFilePath:(NSString *_Nonnull)filePath mimeType:(NSString *_Nonnull)mimeType

Parameters

filePath

Attachment file path.

mimeType

Attachment mime type.

Declared In

TTMessageRequest.h

– addMessageMetadata:mimeType:payload:

Add message metadata.

- (void)addMessageMetadata:(NSString *_Nonnull)metadataNamespace mimeType:(NSString *_Nonnull)mimeType payload:(NSString *_Nonnull)payload

Parameters

metadataNamespace

namespace.

mimeType

metadata mime type.

payload

metadata payload.

Declared In

TTMessageRequest.h