public interface StringeeConnectionListener
Monitors when the client connects or disconnects from Stringee server.
| Public methods | |
|---|---|
void |
void onConnectionConnected(StringeeClient client, boolean isReconnecting)
Perform on connection connected. |
void |
void onConnectionDisconnected(StringeeClient client, boolean isReconnecting)
Perform on connection disconnected. |
void |
void onIncomingCall(StringeeCall stringeeCall)
Perform on incoming call. |
void |
void onIncomingCall2(StringeeCall2 stringeeCall)
Perform on incoming call2. |
void |
void onConnectionError(StringeeClient client, StringeeError error)
Perform on connection error. |
void |
void onRequestNewToken(StringeeClient client)
Perform on request new token. |
void |
void onTokenWillExpire(StringeeClient client, long exp, int expireInSeconds)
Called shortly before the access token expires. |
void |
void onCustomMessage(String from, JSONObject msg)
Perform on custom message. |
void |
void onTopicMessage(String from, JSONObject msg)
Perform on topic message. |
void onConnectionConnected(StringeeClient client, boolean isReconnecting)
Perform on connection connected.
void onConnectionDisconnected(StringeeClient client, boolean isReconnecting)
Perform on connection disconnected.
void onIncomingCall(StringeeCall stringeeCall)
Perform on incoming call.
void onIncomingCall2(StringeeCall2 stringeeCall)
Perform on incoming call2.
void onConnectionError(StringeeClient client, StringeeError error)
Perform on connection error.
void onRequestNewToken(StringeeClient client)
Called when the access token is expired or invalid, including when the server closed the connection because the token expired. Connect again with a new token; the client does not reconnect with the expired token.
void onTokenWillExpire(StringeeClient client, long exp, int expireInSeconds)
Called about 60 seconds before the access token expires, on servers that support token expiration. Get a new token for the same user from your server and call client.updateToken(newToken, listener) to renew it without reconnecting. If the token is not renewed, the server disconnects the client when it expires and onRequestNewToken is called. Optional: it has a default empty implementation. Available from SDK 2.1.17.
exp: expiration time of the token, in seconds since the epoch.
expireInSeconds: seconds left before the token expires.
void onCustomMessage(String from, JSONObject msg)
Perform on custom message.
void onTopicMessage(String from, JSONObject msg)
Perform on topic message.