TCHMessageOptions Class Reference

Inherits from NSObject
Declared in TCHMessageOptions.h

Overview

Creation options for new messages within Conversations

– withBody:

Sets body for the new message to be created.

- (nonnull instancetype)withBody:(nonnull NSString *)body

Parameters

body

The new message body.

Return Value

A referece to this options object for convenience in chaining.

Discussion

Sets body for the new message to be created.

Note: Specifying both body and media will result in the body being ignored at the present time, replacing it with the media place-holder defined on your instance.

Declared In

TCHMessageOptions.h

– withMediaStream:contentType:defaultFilename:onStarted:onProgress:onCompleted:

Supplies a media upload for the message to be created.

- (nonnull instancetype)withMediaStream:(nonnull NSInputStream *)mediaStream contentType:(nonnull NSString *)contentType defaultFilename:(nullable NSString *)defaultFilename onStarted:(nullable TCHMediaOnStarted)onStarted onProgress:(nullable TCHMediaOnProgress)onProgress onCompleted:(nullable TCHMediaOnCompleted)onCompleted

Parameters

mediaStream

An NSInputStream that will be used as the source for the new media message.

contentType

The mime type of the attached media.

defaultFilename

An optional recommended default filename clients may use when downloading the file.

onStarted

Callback block which is called when the media upload starts.

onProgress

Callback block which is called as upload progresses with the most recent number of bytes written.

onCompleted

Callback block which is called upon media upload completion with the media’s sid if successful.

Return Value

A reference to this options object for convenience in chaining.

Discussion

Supplies a media upload for the message to be created.

Note: Specifying both body and media will result in the body being ignored at the present time, replacing it with the media place-holder defined on your instance. Note: After media message is sent, other clients are able to request temporary URL to media content by TCHMessage.getMediaContentTemporaryUrlWithCompletion() and then download it.

Declared In

TCHMessageOptions.h

– withAttributes:error:

Sets user defined attributes for the new message.

- (nullable instancetype)withAttributes:(nonnull TCHJsonAttributes *)attributes error:(TCHError *_Nullable *_Nullable)error

Parameters

attributes

The new developer-defined extensible attributes for this message. (Supported types are NSString, NSNumber, NSArray, NSDictionary and NSNull)

error

An error which will indicate the failure of setting the attributes.

Return Value

A reference to this options object for convenience in chaining or nil in the event the attributes could not be parsed/updated.

Discussion

Sets user defined attributes for the new message.

Declared In

TCHMessageOptions.h