TCHChannel Class Reference
| Inherits from | NSObject | 
|---|---|
| Declared in | TCHChannel.h | 
  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> delegateDiscussion
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 *sidDiscussion
The unique identifier for this channel.
Declared In
TCHChannel.h
  friendlyName
	The friendly name for this channel.
@property (nonatomic, copy, readonly, nullable) NSString *friendlyNameDiscussion
The friendly name for this channel.
Declared In
TCHChannel.h
  uniqueName
	The unique name for this channel.
@property (nonatomic, copy, readonly, nullable) NSString *uniqueNameDiscussion
The unique name for this channel.
Declared In
TCHChannel.h
  messages
	The messages list object for this channel.
@property (nonatomic, strong, readonly, nullable) TCHMessages *messagesDiscussion
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 *membersDiscussion
The members list object for this channel.
Declared In
TCHChannel.h
  status
	The current user’s status on this channel.
@property (nonatomic, assign, readonly) TCHChannelStatus statusDiscussion
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 notificationLevelDiscussion
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 typeDiscussion
The channel’s visibility type.
Declared In
TCHChannel.h
  dateCreated
	The timestamp the channel was created.
@property (nonatomic, strong, readonly, nullable) NSString *dateCreatedDiscussion
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 *dateCreatedAsDateDiscussion
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 *createdByDiscussion
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 *dateUpdatedDiscussion
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 *dateUpdatedAsDateDiscussion
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 *lastMessageDateDiscussion
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 *lastMessageIndexDiscussion
The index of the channel’s most recent message.
Declared In
TCHChannel.h
– attributes
	Return this channel’s attributes.
- (nullable TCHJsonAttributes *)attributesReturn 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 TCHJsonAttributes *)attributes completion:(nullable TCHCompletion)completionParameters
| 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)completionParameters
| 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)completionParameters
| 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)completionParameters
| 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)completionParameters
| 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)completionParameters
| 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)completionParameters
| 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)completionParameters
| 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)typingDiscussion
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 *)identityParameters
| 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)completionParameters
| 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.
Use this method to obtain number of unread messages together with [TCHMessages setLastConsumedMessageIndex:completion:] instead of relying on TCHMessage indices which may have gaps. See [TCHMessage index] for details.
Available even if the channel is not yet synchronized.
This method is semi-realtime. This means that this data will be eventually correct, but will also possibly be incorrect for a few seconds. The Chat system does not provide real time events for counter values changes.
So this is quite useful for any “unread messages count” badges, but is not recommended to build any core application logic based on these counters being accurate in real time. This function performs an async call to service to obtain up-to-date message count.
The retrieved value is then cached for 5 seconds so there is no reason to call this function more often than once in 5 seconds.
Declared In
TCHChannel.h
– getMessagesCountWithCompletion:
	Fetch the number of messages on this channel.
- (void)getMessagesCountWithCompletion:(nonnull TCHCountCompletion)completionParameters
| 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.
This method is semi-realtime. This means that this data will be eventually correct, but will also possibly be incorrect for a few seconds. The Chat system does not provide real time events for counter values changes.
So this is quite useful for any UI badges, but is not recommended to build any core application logic based on these counters being accurate in real time. This function performs an async call to service to obtain up-to-date message count.
The retrieved value is then cached for 5 seconds so there is no reason to call this function more often than once in 5 seconds.
Declared In
TCHChannel.h
– getMembersCountWithCompletion:
	Fetch the number of members on this channel.
- (void)getMembersCountWithCompletion:(nonnull TCHCountCompletion)completionParameters
| 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.
This method is semi-realtime. This means that this data will be eventually correct, but will also possibly be incorrect for a few seconds. The Chat system does not provide real time events for counter values changes.
So this is quite useful for any UI badges, but is not recommended to build any core application logic based on these counters being accurate in real time. This function performs an async call to service to obtain up-to-date message count.
The retrieved value is then cached for 5 seconds so there is no reason to call this function more often than once in 5 seconds.
Declared In
TCHChannel.h