TCHChannel Class Reference

Inherits from NSObject
Declared in TCHChannel.h

Overview

Representation of a chat channel.

  delegate

Optional channel delegate. Upon setting the delegate, you will receive the current channel synchronization status by delegate method.

@property (nonatomic, weak, nullable) id<TCHChannelDelegate> delegate

Discussion

Optional channel delegate. Upon setting the delegate, you will receive the current channel synchronization status by delegate method.

Declared In

TCHChannel.h

  sid

The unique identifier for this channel.

@property (nonatomic, copy, readonly, nullable) NSString *sid

Discussion

The unique identifier for this channel.

Declared In

TCHChannel.h

  friendlyName

The friendly name for this channel.

@property (nonatomic, copy, readonly, nullable) NSString *friendlyName

Discussion

The friendly name for this channel.

Declared In

TCHChannel.h

  uniqueName

The unique name for this channel.

@property (nonatomic, copy, readonly, nullable) NSString *uniqueName

Discussion

The unique name for this channel.

Declared In

TCHChannel.h

  messages

The messages list object for this channel.

@property (nonatomic, strong, readonly, nullable) TCHMessages *messages

Discussion

The messages list object for this channel.

Declared In

TCHChannel.h

  members

The members list object for this channel.

@property (nonatomic, strong, readonly, nullable) TCHMembers *members

Discussion

The members list object for this channel.

Declared In

TCHChannel.h

  synchronizationStatus

The channel’s synchronization status.

@property (nonatomic, assign, readonly) TCHChannelSynchronizationStatus synchronizationStatus

Discussion

The channel’s synchronization status.

Declared In

TCHChannel.h

  status

The current user’s status on this channel.

@property (nonatomic, assign, readonly) TCHChannelStatus status

Discussion

The current user’s status on this channel.

Declared In

TCHChannel.h

  notificationLevel

The current user’s notification level on this channel. This property reflects whether the user will receive push notifications for activity on this channel.

@property (nonatomic, assign, readonly) TCHChannelNotificationLevel notificationLevel

Discussion

The current user’s notification level on this channel. This property reflects whether the user will receive push notifications for activity on this channel.

Declared In

TCHChannel.h

  type

The channel’s visibility type.

@property (nonatomic, assign, readonly) TCHChannelType type

Discussion

The channel’s visibility type.

Declared In

TCHChannel.h

  dateCreated

The timestamp the channel was created.

@property (nonatomic, strong, readonly, nullable) NSString *dateCreated

Discussion

The timestamp the channel was created.

Declared In

TCHChannel.h

  dateCreatedAsDate

The timestamp the channel was created as an NSDate.

@property (nonatomic, strong, readonly, nullable) NSDate *dateCreatedAsDate

Discussion

The timestamp the channel was created as an NSDate.

Declared In

TCHChannel.h

  createdBy

The identity of the channel’s creator.

@property (nonatomic, copy, readonly, nullable) NSString *createdBy

Discussion

The identity of the channel’s creator.

Declared In

TCHChannel.h

  dateUpdated

The timestamp the channel was last updated.

@property (nonatomic, strong, readonly, nullable) NSString *dateUpdated

Discussion

The timestamp the channel was last updated.

Declared In

TCHChannel.h

  dateUpdatedAsDate

The timestamp the channel was last updated as an NSDate.

@property (nonatomic, strong, readonly, nullable) NSDate *dateUpdatedAsDate

Discussion

The timestamp the channel was last updated as an NSDate.

Declared In

TCHChannel.h

  lastMessageDate

The timestamp of the channel’s most recent message.

@property (nonatomic, strong, readonly, nullable) NSDate *lastMessageDate

Discussion

The timestamp of the channel’s most recent message.

Declared In

TCHChannel.h

  lastMessageIndex

The index of the channel’s most recent message.

@property (nonatomic, strong, readonly, nullable) NSNumber *lastMessageIndex

Discussion

The index of the channel’s most recent message.

Declared In

TCHChannel.h

– attributes

Return this channel’s attributes.

- (nullable NSDictionary<NSString*,id> *)attributes

Return Value

The developer-defined extensible attributes for this channel.

Discussion

Return this channel’s attributes.

Declared In

TCHChannel.h

– setAttributes:completion:

Set this channel’s attributes.

- (void)setAttributes:(nullable NSDictionary<NSString*,id> *)attributes completion:(nullable TCHCompletion)completion

Parameters

attributes

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

completion

Completion block that will specify the result of the operation.

Discussion

Set this channel’s attributes.

Declared In

TCHChannel.h

– setFriendlyName:completion:

Set this channel’s friendly name.

- (void)setFriendlyName:(nullable NSString *)friendlyName completion:(nullable TCHCompletion)completion

Parameters

friendlyName

The new friendly name for this channel.

completion

Completion block that will specify the result of the operation.

Discussion

Set this channel’s friendly name.

Declared In

TCHChannel.h

– setUniqueName:completion:

Set this channel’s unique name.

- (void)setUniqueName:(nullable NSString *)uniqueName completion:(nullable TCHCompletion)completion

Parameters

uniqueName

The new unique name for this channel.

completion

Completion block that will specify the result of the operation.

Discussion

Set this channel’s unique name.

Declared In

TCHChannel.h

– setNotificationLevel:completion:

Set the user’s notification level for the channel. This property determines whether the user will receive push notifications for activity on this channel.

- (void)setNotificationLevel:(TCHChannelNotificationLevel)notificationLevel completion:(nullable TCHCompletion)completion

Parameters

notificationLevel

The new notification level for the current user on this channel.

completion

Completion block that will specify the result of the operation.

Discussion

Set the user’s notification level for the channel. This property determines whether the user will receive push notifications for activity on this channel.

Declared In

TCHChannel.h

– joinWithCompletion:

Join the current user to this channel.

- (void)joinWithCompletion:(nullable TCHCompletion)completion

Parameters

completion

Completion block that will specify the result of the operation.

Discussion

Join the current user to this channel.

Declared In

TCHChannel.h

– declineInvitationWithCompletion:

Decline an invitation to this channel.

- (void)declineInvitationWithCompletion:(nullable TCHCompletion)completion

Parameters

completion

Completion block that will specify the result of the operation.

Discussion

Decline an invitation to this channel.

Declared In

TCHChannel.h

– leaveWithCompletion:

Leave the current channel.

- (void)leaveWithCompletion:(nullable TCHCompletion)completion

Parameters

completion

Completion block that will specify the result of the operation.

Discussion

Leave the current channel.

Declared In

TCHChannel.h

– destroyWithCompletion:

Destroy the current channel, removing all of its members.

- (void)destroyWithCompletion:(nullable TCHCompletion)completion

Parameters

completion

Completion block that will specify the result of the operation.

Discussion

Destroy the current channel, removing all of its members.

Declared In

TCHChannel.h

– typing

Indicates to other users and the backend that the user is typing a message to this channel.

- (void)typing

Discussion

Indicates to other users and the backend that the user is typing a message to this channel.

Declared In

TCHChannel.h

– memberWithIdentity:

Fetch the member object for the given identity if it exists.

- (nullable TCHMember *)memberWithIdentity:(nonnull NSString *)identity

Parameters

identity

The username to fetch.

Return Value

The TCHMember object, if one exists for the username for this channel.

Discussion

Fetch the member object for the given identity if it exists.

Declared In

TCHChannel.h

– getUnconsumedMessagesCountWithCompletion:

Fetch the number of unconsumed messages on this channel for the current user.

- (void)getUnconsumedMessagesCountWithCompletion:(nonnull TCHCountCompletion)completion

Parameters

completion

Completion block that will specify the requested count. If no completion block is specified, no operation will be executed.

Discussion

Fetch the number of unconsumed messages on this channel for the current user.

Available even if the channel is not yet synchronized. Subsequent calls of this method prior to the local cache’s expiry will return cached values.

Declared In

TCHChannel.h

– getMessagesCountWithCompletion:

Fetch the number of messages on this channel.

- (void)getMessagesCountWithCompletion:(nonnull TCHCountCompletion)completion

Parameters

completion

Completion block that will specify the requested count. If no completion block is specified, no operation will be executed.

Discussion

Fetch the number of messages on this channel.

Available even if the channel is not yet synchronized.

Available even if the channel is not yet synchronized. Subsequent calls of this method prior to the local cache’s expiry will return cached values.

Declared In

TCHChannel.h

– getMembersCountWithCompletion:

Fetch the number of members on this channel.

- (void)getMembersCountWithCompletion:(nonnull TCHCountCompletion)completion

Parameters

completion

Completion block that will specify the requested count. If no completion block is specified, no operation will be executed.

Discussion

Fetch the number of members on this channel.

Available even if the channel is not yet synchronized.

Available even if the channel is not yet synchronized. Subsequent calls of this method prior to the local cache’s expiry will return cached values.

Declared In

TCHChannel.h