TwilioChatClientDelegate Protocol Reference

Conforms to NSObject
Declared in TwilioChatClient.h

Overview

This protocol declares the chat client delegate methods.

– chatClient:connectionStateUpdated:

Called when the client connection state changes.

- (void)chatClient:(TwilioChatClient *)client connectionStateUpdated:(TCHClientConnectionState)state

Parameters

client

The chat client.

state

The current connection state of the client.

Discussion

Called when the client connection state changes.

Declared In

TwilioChatClient.h

– chatClient:synchronizationStatusUpdated:

Called when the client synchronization state changes during startup.

- (void)chatClient:(TwilioChatClient *)client synchronizationStatusUpdated:(TCHClientSynchronizationStatus)status

Parameters

client

The chat client.

status

The current synchronization status of the client.

Discussion

Called when the client synchronization state changes during startup.

Declared In

TwilioChatClient.h

– chatClient:channelAdded:

Called when the current user has a channel added to their channel list.

- (void)chatClient:(TwilioChatClient *)client channelAdded:(TCHChannel *)channel

Parameters

client

The chat client.

channel

The channel.

Discussion

Called when the current user has a channel added to their channel list.

Declared In

TwilioChatClient.h

– chatClient:channel:updated:

Called when one of the current users channels is changed.

- (void)chatClient:(TwilioChatClient *)client channel:(TCHChannel *)channel updated:(TCHChannelUpdate)updated

Parameters

client

The chat client.

channel

The channel.

updated

An indication of what changed on the channel.

Discussion

Called when one of the current users channels is changed.

Declared In

TwilioChatClient.h

– chatClient:channelDeleted:

Called when one of the current users channels is deleted.

- (void)chatClient:(TwilioChatClient *)client channelDeleted:(TCHChannel *)channel

Parameters

client

The chat client.

channel

The channel.

Discussion

Called when one of the current users channels is deleted.

Declared In

TwilioChatClient.h

– chatClient:channel:memberJoined:

Called when a channel the current user is subscribed to has a new member join.

- (void)chatClient:(TwilioChatClient *)client channel:(TCHChannel *)channel memberJoined:(TCHMember *)member

Parameters

client

The chat client.

channel

The channel.

member

The member.

Discussion

Called when a channel the current user is subscribed to has a new member join.

Declared In

TwilioChatClient.h

– chatClient:channel:member:updated:

Called when a channel the current user is subscribed to has a member modified.

- (void)chatClient:(TwilioChatClient *)client channel:(TCHChannel *)channel member:(TCHMember *)member updated:(TCHMemberUpdate)updated

Parameters

client

The chat client.

channel

The channel.

member

The member.

updated

An indication of what changed on the member.

Discussion

Called when a channel the current user is subscribed to has a member modified.

Declared In

TwilioChatClient.h

– chatClient:channel:memberLeft:

Called when a channel the current user is subscribed to has a member leave.

- (void)chatClient:(TwilioChatClient *)client channel:(TCHChannel *)channel memberLeft:(TCHMember *)member

Parameters

client

The chat client.

channel

The channel.

member

The member.

Discussion

Called when a channel the current user is subscribed to has a member leave.

Declared In

TwilioChatClient.h

– chatClient:channel:messageAdded:

Called when a channel the current user is subscribed to receives a new message.

- (void)chatClient:(TwilioChatClient *)client channel:(TCHChannel *)channel messageAdded:(TCHMessage *)message

Parameters

client

The chat client.

channel

The channel.

message

The message.

Discussion

Called when a channel the current user is subscribed to receives a new message.

Declared In

TwilioChatClient.h

– chatClient:channel:message:updated:

Called when a message on a channel the current user is subscribed to is modified.

- (void)chatClient:(TwilioChatClient *)client channel:(TCHChannel *)channel message:(TCHMessage *)message updated:(TCHMessageUpdate)updated

Parameters

client

The chat client.

channel

The channel.

message

The message.

updated

An indication of what changed on the message.

Discussion

Called when a message on a channel the current user is subscribed to is modified.

Declared In

TwilioChatClient.h

– chatClient:channel:messageDeleted:

Called when a message on a channel the current user is subscribed to is deleted.

- (void)chatClient:(TwilioChatClient *)client channel:(TCHChannel *)channel messageDeleted:(TCHMessage *)message

Parameters

client

The chat client.

channel

The channel.

message

The message.

Discussion

Called when a message on a channel the current user is subscribed to is deleted.

Declared In

TwilioChatClient.h

– chatClient:errorReceived:

Called when an error occurs.

- (void)chatClient:(TwilioChatClient *)client errorReceived:(TCHError *)error

Parameters

client

The chat client.

error

The error.

Discussion

Called when an error occurs.

Declared In

TwilioChatClient.h

– chatClient:typingStartedOnChannel:member:

Called when a member of a channel starts typing.

- (void)chatClient:(TwilioChatClient *)client typingStartedOnChannel:(TCHChannel *)channel member:(TCHMember *)member

Parameters

client

The chat client.

channel

The channel.

member

The member.

Discussion

Called when a member of a channel starts typing.

Declared In

TwilioChatClient.h

– chatClient:typingEndedOnChannel:member:

Called when a member of a channel ends typing.

- (void)chatClient:(TwilioChatClient *)client typingEndedOnChannel:(TCHChannel *)channel member:(TCHMember *)member

Parameters

client

The chat client.

channel

The channel.

member

The member.

Discussion

Called when a member of a channel ends typing.

Declared In

TwilioChatClient.h

– chatClient:notificationNewMessageReceivedForChannelSid:messageIndex:

Called as a result of TwilioChatClient’s handleNotification: method being invoked. handleNotification: parses the push payload and extracts the channel and message for the push notification then calls this delegate method.

- (void)chatClient:(TwilioChatClient *)client notificationNewMessageReceivedForChannelSid:(NSString *)channelSid messageIndex:(NSUInteger)messageIndex

Parameters

client

The chat client.

channelSid

The channel sid for the push notification.

messageIndex

The index of the new message.

Discussion

Called as a result of TwilioChatClient’s handleNotification: method being invoked. handleNotification: parses the push payload and extracts the channel and message for the push notification then calls this delegate method.

Declared In

TwilioChatClient.h

– chatClient:notificationUpdatedBadgeCount:

Called when a processed push notification has changed the application’s badge count. You should call:

- (void)chatClient:(TwilioChatClient *)client notificationUpdatedBadgeCount:(NSUInteger)badgeCount

Parameters

client

The chat client.

badgeCount

The updated badge count.

Discussion

Called when a processed push notification has changed the application’s badge count. You should call:

[[UIApplication currentApplication] setApplicationIconBadgeNumber:badgeCount]

To ensure your application’s badge updates when the application is in the foreground if Twilio is managing your badge counts. You may disregard this delegate callback otherwise.

Declared In

TwilioChatClient.h

– chatClient:user:updated:

Called when the current user’s or that of any subscribed channel member’s user is updated.

- (void)chatClient:(TwilioChatClient *)client user:(TCHUser *)user updated:(TCHUserUpdate)updated

Parameters

client

The chat client.

user

The object for changed user.

updated

An indication of what changed on the user.

Discussion

Called when the current user’s or that of any subscribed channel member’s user is updated.

Declared In

TwilioChatClient.h

– chatClient:userSubscribed:

Called when the client subscribes to updates for a given user.

- (void)chatClient:(TwilioChatClient *)client userSubscribed:(TCHUser *)user

Parameters

client

The chat client.

user

The object for subscribed user.

Discussion

Called when the client subscribes to updates for a given user.

Declared In

TwilioChatClient.h

– chatClient:userUnsubscribed:

Called when the client unsubscribes from updates for a given user.

- (void)chatClient:(TwilioChatClient *)client userUnsubscribed:(TCHUser *)user

Parameters

client

The chat client.

user

The object for unsubscribed user.

Discussion

Called when the client unsubscribes from updates for a given user.

Declared In

TwilioChatClient.h