TwilioSyncClientDelegate Protocol Reference

Conforms to NSObject
Declared in TwilioSyncClient.h

Overview

This protocol declares the Sync client delegate methods.

– syncClient:connectionStateChanged:

Called when the client connection state changes.

- (void)syncClient:(nonnull TwilioSyncClient *)client connectionStateChanged:(TWSClientConnectionState)state

Parameters

client

The sync client.

state

The current connection state of the client.

Discussion

Called when the client connection state changes.

Declared In

TwilioSyncClient.h

– syncClientTokenExpired:

Called when the client’s token has expired.

- (void)syncClientTokenExpired:(nonnull TwilioSyncClient *)client

Parameters

client

The sync client.

Discussion

Called when the client’s token has expired.

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

Declared In

TwilioSyncClient.h

– syncClientTokenWillExpire:

Called when the client’s token will expire soon.

- (void)syncClientTokenWillExpire:(nonnull TwilioSyncClient *)client

Parameters

client

The sync client.

Discussion

Called when the client’s token will expire soon.

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

Declared In

TwilioSyncClient.h

– syncClient:errorReceived:

Called when an error occurs.

- (void)syncClient:(nonnull TwilioSyncClient *)client errorReceived:(nonnull TWSError *)error

Parameters

client

The sync client.

error

The error.

Discussion

Called when an error occurs.

Declared In

TwilioSyncClient.h