TwilioChatClient Class Reference

Inherits from NSObject
Declared in TwilioChatClient.h

Overview

Represents a chat client connection to Twilio.

  delegate

Messaging client delegate

@property (nonatomic, weak) id<TwilioChatClientDelegate> delegate

Discussion

Messaging client delegate

Declared In

TwilioChatClient.h

  userInfo

The info for the logged in user in the chat system.

@property (nonatomic, strong, readonly) TCHUserInfo *userInfo

Discussion

The info for the logged in user in the chat system.

Declared In

TwilioChatClient.h

  connectionState

The client’s current connection state.

@property (nonatomic, assign, readonly) TCHClientConnectionState connectionState

Discussion

The client’s current connection state.

Declared In

TwilioChatClient.h

  synchronizationStatus

The current client synchronization state.

@property (nonatomic, assign, readonly) TCHClientSynchronizationStatus synchronizationStatus

Discussion

The current client synchronization state.

Declared In

TwilioChatClient.h

+ setLogLevel:

Sets the logging level for the client.

+ (void)setLogLevel:(TCHLogLevel)logLevel

Parameters

logLevel

The new log level.

Discussion

Sets the logging level for the client.

Declared In

TwilioChatClient.h

+ logLevel

The logging level for the client.

+ (TCHLogLevel)logLevel

Return Value

The log level.

Discussion

The logging level for the client.

Declared In

TwilioChatClient.h

+ chatClientWithToken:properties:delegate:

Initialize a new chat client instance with a token manager.

+ (TwilioChatClient *)chatClientWithToken:(NSString *)token properties:(TwilioChatClientProperties *)properties delegate:(id<TwilioChatClientDelegate>)delegate

Parameters

token

The client access token to use when communicating with Twilio.

properties

The properties to initialize the client with, if this is nil defaults will be used.

delegate

Delegate conforming to TwilioChatClientDelegate for chat client lifecycle notifications.

Return Value

New chat client instance.

Discussion

Initialize a new chat client instance with a token manager.

Declared In

TwilioChatClient.h

– version

Returns the version of the SDK

- (NSString *)version

Return Value

The chat client version.

Discussion

Returns the version of the SDK

Declared In

TwilioChatClient.h

– updateToken:

Updates the access token currently being used by the client.

- (void)updateToken:(NSString *)token

Parameters

token

The updated client access token to use when communicating with Twilio.

Discussion

Updates the access token currently being used by the client.

Declared In

TwilioChatClient.h

– channelsList

List of channels available to the current user.

- (TCHChannels *)channelsList

Return Value

The channelsList object.

Discussion

List of channels available to the current user.

This will be nil until the client is fully initialized, see the client delegate callback chatClient:updated:

Declared In

TwilioChatClient.h

– registerWithToken:

Register APNS token for push notification updates.

- (void)registerWithToken:(NSData *)token

Parameters

token

The APNS token which usually comes from ‘didRegisterForRemoteNotificationsWithDeviceToken’.

Discussion

Register APNS token for push notification updates.

Declared In

TwilioChatClient.h

– deregisterWithToken:

De-register from push notification updates.

- (void)deregisterWithToken:(NSData *)token

Parameters

token

The APNS token which usually comes from ‘didRegisterForRemoteNotificationsWithDeviceToken’.

Discussion

De-register from push notification updates.

Declared In

TwilioChatClient.h

– handleNotification:

Queue the incoming notification with the messaging library for processing - notifications usually arrive from ‘didReceiveRemoteNotification’.

- (void)handleNotification:(NSDictionary *)notification

Parameters

notification

The incomming notification.

Discussion

Queue the incoming notification with the messaging library for processing - notifications usually arrive from ‘didReceiveRemoteNotification’.

Declared In

TwilioChatClient.h

– isReachabilityEnabled

Indicates whether reachability is enabled for this instance.

- (BOOL)isReachabilityEnabled

Return Value

YES if reachability is enabled.

Discussion

Indicates whether reachability is enabled for this instance.

Declared In

TwilioChatClient.h

– shutdown

Cleanly shut down the messaging subsystem when you are done with it.

- (void)shutdown

Discussion

Cleanly shut down the messaging subsystem when you are done with it.

Declared In

TwilioChatClient.h