TCHMessageOptions Class Reference

Inherits from NSObject
Declared in TCHMessageOptions.h

Overview

Creation options for new messages within Programmable Chat

– 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.

Declared In

TCHMessageOptions.h

– withAttributes:completion:

Sets user defined attributes for the new message.

- (nullable instancetype)withAttributes:(nonnull NSDictionary<NSString*,id> *)attributes completion:(nullable TCHCompletion)completion

Parameters

attributes

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

completion

A completion block which will indicate the success or 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