TwilioConversationsClientDelegate Protocol Reference

Conforms to NSObject
Declared in TCHConversationsClient.h

Overview

This protocol declares the conversations client delegate methods.

– conversationsClient:connectionStateUpdated:

Called when the client connection state changes.

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client connectionStateUpdated:(TCHClientConnectionState)state

Parameters

client

The conversations client.

state

The current connection state of the client.

Discussion

Called when the client connection state changes.

Declared In

TCHConversationsClient.h

– conversationsClientTokenExpired:

Called when the client’s token has expired.

- (void)conversationsClientTokenExpired:(nonnull TwilioConversationsClient *)client

Parameters

client

The conversations client.

Discussion

Called when the client’s token has expired.

In response, your delegate should generate a new token and call conversationsClient:updateToken:completion: immediately as connection to the server has been lost.

Declared In

TCHConversationsClient.h

– conversationsClientTokenWillExpire:

Called when the client’s token will expire soon.

- (void)conversationsClientTokenWillExpire:(nonnull TwilioConversationsClient *)client

Parameters

client

The conversations client.

Discussion

Called when the client’s token will expire soon.

In response, your delegate should generate a new token and call conversationsClient:updateToken:completion: as soon as possible.

Declared In

TCHConversationsClient.h

– conversationsClient:synchronizationStatusUpdated:

Called when the client synchronization state changes during startup.

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client synchronizationStatusUpdated:(TCHClientSynchronizationStatus)status

Parameters

client

The conversations client.

status

The current synchronization status of the client.

Discussion

Called when the client synchronization state changes during startup.

Declared In

TCHConversationsClient.h

– conversationsClient:conversationAdded:

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

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client conversationAdded:(nonnull TCHConversation *)conversation

Parameters

client

The conversations client.

conversation

The conversation.

Discussion

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

Declared In

TCHConversationsClient.h

– conversationsClient:conversation:updated:

Called when one of the current users conversations is changed.

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client conversation:(nonnull TCHConversation *)conversation updated:(TCHConversationUpdate)updated

Parameters

client

The conversations client.

conversation

The conversation.

updated

An indication of what changed on the conversation.

Discussion

Called when one of the current users conversations is changed.

Declared In

TCHConversationsClient.h

– conversationsClient:conversation:synchronizationStatusUpdated:

Called when the conversation synchronization state is changed.

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client conversation:(nonnull TCHConversation *)conversation synchronizationStatusUpdated:(TCHConversationSynchronizationStatus)status

Parameters

client

The conversations client.

conversation

The conversation.

status

The current synchronization status of the conversation.

Discussion

Called when the conversation synchronization state is changed.

Declared In

TCHConversationsClient.h

– conversationsClient:conversationDeleted:

Called when one of the current users conversations is deleted.

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client conversationDeleted:(nonnull TCHConversation *)conversation

Parameters

client

The conversations client.

conversation

The conversation.

Discussion

Called when one of the current users conversations is deleted.

Declared In

TCHConversationsClient.h

– conversationsClient:conversation:participantJoined:

Called when a conversation the current user is subscribed to has a new participant join.

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client conversation:(nonnull TCHConversation *)conversation participantJoined:(nonnull TCHParticipant *)participant

Parameters

client

The conversations client.

conversation

The conversation.

participant

The participant.

Discussion

Called when a conversation the current user is subscribed to has a new participant join.

Declared In

TCHConversationsClient.h

– conversationsClient:conversation:participant:updated:

Called when a conversation the current user is subscribed to has a participant modified.

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client conversation:(nonnull TCHConversation *)conversation participant:(nonnull TCHParticipant *)participant updated:(TCHParticipantUpdate)updated

Parameters

client

The conversations client.

conversation

The conversation.

participant

The participant.

updated

An indication of what changed on the participant.

Discussion

Called when a conversation the current user is subscribed to has a participant modified.

Declared In

TCHConversationsClient.h

– conversationsClient:conversation:participantLeft:

Called when a conversation the current user is subscribed to has a participant leave.

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client conversation:(nonnull TCHConversation *)conversation participantLeft:(nonnull TCHParticipant *)participant

Parameters

client

The conversations client.

conversation

The conversation.

participant

The participant.

Discussion

Called when a conversation the current user is subscribed to has a participant leave.

Declared In

TCHConversationsClient.h

– conversationsClient:conversation:messageAdded:

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

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client conversation:(nonnull TCHConversation *)conversation messageAdded:(nonnull TCHMessage *)message

Parameters

client

The conversations client.

conversation

The conversation.

message

The message.

Discussion

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

Declared In

TCHConversationsClient.h

– conversationsClient:conversation:message:updated:

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

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client conversation:(nonnull TCHConversation *)conversation message:(nonnull TCHMessage *)message updated:(TCHMessageUpdate)updated

Parameters

client

The conversations client.

conversation

The conversation.

message

The message.

updated

An indication of what changed on the message.

Discussion

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

Declared In

TCHConversationsClient.h

– conversationsClient:conversation:messageDeleted:

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

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client conversation:(nonnull TCHConversation *)conversation messageDeleted:(nonnull TCHMessage *)message

Parameters

client

The conversations client.

conversation

The conversation.

message

The message.

Discussion

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

Declared In

TCHConversationsClient.h

– conversationsClient:errorReceived:

Called when an error occurs.

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client errorReceived:(nonnull TCHError *)error

Parameters

client

The conversations client.

error

The error.

Discussion

Called when an error occurs.

Declared In

TCHConversationsClient.h

– conversationsClient:typingStartedOnConversation:participant:

Called when a participant of a conversation starts typing.

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client typingStartedOnConversation:(nonnull TCHConversation *)conversation participant:(nonnull TCHParticipant *)participant

Parameters

client

The conversations client.

conversation

The conversation.

participant

The participant.

Discussion

Called when a participant of a conversation starts typing.

Declared In

TCHConversationsClient.h

– conversationsClient:typingEndedOnConversation:participant:

Called when a participant of a conversation ends typing.

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client typingEndedOnConversation:(nonnull TCHConversation *)conversation participant:(nonnull TCHParticipant *)participant

Parameters

client

The conversations client.

conversation

The conversation.

participant

The participant.

Discussion

Called when a participant of a conversation ends typing.

Declared In

TCHConversationsClient.h

– conversationsClient:notificationNewMessageReceivedForConversationSid:messageIndex:

Called as a result of TwilioConversationsClient’s handleNotification: method being invoked for a new message received notification. handleNotification: parses the push payload and extracts the new message’s conversation and index for the push notification then calls this delegate method.

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client notificationNewMessageReceivedForConversationSid:(nonnull NSString *)conversationSid messageIndex:(NSUInteger)messageIndex

Parameters

client

The conversations client.

conversationSid

The conversation sid for the new message.

messageIndex

The index of the new message.

Discussion

Called as a result of TwilioConversationsClient’s handleNotification: method being invoked for a new message received notification. handleNotification: parses the push payload and extracts the new message’s conversation and index for the push notification then calls this delegate method.

Declared In

TCHConversationsClient.h

– conversationsClient:notificationAddedToConversationWithSid:

Called as a result of TwilioConversationsClient’s handleNotification: method being invoked for an added to conversation notification. handleNotification: parses the push payload and extracts the conversation for the push notification then calls this delegate method.

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client notificationAddedToConversationWithSid:(nonnull NSString *)conversationSid

Parameters

client

The conversations client.

conversationSid

The conversation sid for the newly added conversation.

Discussion

Called as a result of TwilioConversationsClient’s handleNotification: method being invoked for an added to conversation notification. handleNotification: parses the push payload and extracts the conversation for the push notification then calls this delegate method.

Declared In

TCHConversationsClient.h

– conversationsClient:notificationRemovedFromConversationWithSid:

Called as a result of TwilioConversationsClient’s handleNotification: method being invoked for a removed from conversation notification. handleNotification: parses the push payload and extracts the conversation for the push notification then calls this delegate method.

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client notificationRemovedFromConversationWithSid:(nonnull NSString *)conversationSid

Parameters

client

The conversations client.

conversationSid

The conversation sid for the removed conversation.

Discussion

Called as a result of TwilioConversationsClient’s handleNotification: method being invoked for a removed from conversation notification. handleNotification: parses the push payload and extracts the conversation for the push notification then calls this delegate method.

Declared In

TCHConversationsClient.h

– conversationsClient:notificationUpdatedBadgeCount:

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

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client notificationUpdatedBadgeCount:(NSUInteger)badgeCount

Parameters

client

The conversations client.

badgeCount

The updated badge count.

Discussion

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

UIApplication.sharedApplication.applicationIconBadgeNumber = badgeCount

Please note that badge count indicates the number of 1:1 conversations (2 participants only) that have unread messages. This does not reflect total unread message count or conversations with more than 2 participants.

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

TCHConversationsClient.h

– conversationsClient:user:updated:

Called when the current user’s or that of any subscribed conversation participant’s user is updated.

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client user:(nonnull TCHUser *)user updated:(TCHUserUpdate)updated

Parameters

client

The conversations 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 conversation participant’s user is updated.

Declared In

TCHConversationsClient.h

– conversationsClient:userSubscribed:

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

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client userSubscribed:(nonnull TCHUser *)user

Parameters

client

The conversations client.

user

The object for subscribed user.

Discussion

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

Declared In

TCHConversationsClient.h

– conversationsClient:userUnsubscribed:

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

- (void)conversationsClient:(nonnull TwilioConversationsClient *)client userUnsubscribed:(nonnull TCHUser *)user

Parameters

client

The conversations client.

user

The object for unsubscribed user.

Discussion

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

Declared In

TCHConversationsClient.h