Suggestions

close search

StringeeConnectionDelegate

@protocol StringeeConnectionDelegate <NSObject>

Used to monitors the client's connection.

- didConnect:isReconnecting:

Invoked when the client connects to Stringee server:
- stringeeClient: The StringeeClient instance.
- isReconnecting = YES: The client is reconnecting.
- isReconnecting = NO: The client connects first time.

- (void)didConnect:(StringeeClient *)stringeeClient isReconnecting:(BOOL)isReconnecting;
- didDisConnect:isReconnecting:

Invoked when the client disconnects from Stringee server:
- stringeeClient: The StringeeClient instance.
- isReconnecting = YES: The client is reconnecting.
- isReconnecting = NO: The client connects first time.

- (void)didDisConnect:(StringeeClient *)stringeeClient isReconnecting:(BOOL)isReconnecting;
- didFailWithError:code:message:

Invoked when the client fails to connect to Stringee server: 
- stringeeClient: The StringeeClient instance.
- code = 1, message = "Access token is empty"
- code = 2, message = "Access token can not be decoded"
- code = 3, message = "Access token invalid format"
- code = 4, message = "Access token does not use HS256"
- code = 5, message = "API key sid or account sid not found"
- code = 6, message = "Access token expired or invalid"
- code = 7, message = "Access token invalid payload"
- code = 8, message = "Project not found"

- (void)didFailWithError:(StringeeClient *)stringeeClient code:(int)code message:(NSString *)message;
- requestAccessToken:

Invoked when the access token is expired. You must get a new token and reconnect:
- stringeeClient: The StringeeClient instance.

- (void)requestAccessToken:(StringeeClient *)stringeeClient;
- didReceiveCustomMessage:message:fromUserId

Invoked when the client receives a custom message from another client:
- stringeeClient: The StringeeClient instance.
- message: Custom message from another client
- userId: User id of the sender.

- (void)didReceiveCustomMessage:(StringeeClient *)stringeeClient message:(NSDictionary *)message fromUserId:(NSString *)userId;