Chat Android SDK
7.0.1
|
Chat client - main entry point for the Chat SDK. More...
Classes | |
enum | ConnectionState |
Represents underlying twilsock connection state. More... | |
class | FCMToken |
Class which represents token received by application from the Firebase Cloud Messaging service. More... | |
class | GCMToken |
Class which represents token received by application from the Google Cloud Messaging service. More... | |
class | LogLevel |
Log level constants for passing to setLogLevel. More... | |
class | Properties |
Properties for client initialization configuration. More... | |
enum | SynchronizationStatus |
Represents client initialization status. More... | |
Public Member Functions | |
Listeners | |
void | addListener (@NonNull ChatClientListener listener) |
Method to add listener for this Client. More... | |
void | removeListener (@NonNull ChatClientListener listener) |
Method to remove listener from this Client. More... | |
void | removeAllListeners () |
Method to remove all listeners from this Client. | |
Push notifications | |
void | registerGCMToken (GCMToken token, StatusListener listener) |
Register GCM token for push notification updates. More... | |
void | unregisterGCMToken (GCMToken token, StatusListener listener) |
Unregister from push notification updates. More... | |
void | registerFCMToken (FCMToken token, StatusListener listener) |
Register Firebase Messaging token for push notification updates. More... | |
void | unregisterFCMToken (FCMToken token, StatusListener listener) |
Unregister from Firebase Messaging updates. More... | |
void | handleNotification (NotificationPayload notification) |
Queue the incoming notification with the chat library for processing. More... | |
Static Public Member Functions | |
static void | setLogLevel (int level) |
Set verbosity level for log messages to be printed to android logcat. More... | |
Getters | |
static String | getSdkVersion () |
Returns the version of the Chat SDK. More... | |
Properties | getProperties () |
Get properties for current client. More... | |
Channels | getChannels () |
Channels available to the ChatClient. More... | |
native ConnectionState | getConnectionState () |
native String | getMyIdentity () |
Get user identity for current user. More... | |
Users | getUsers () |
Get Users interface. More... | |
native boolean | isReachabilityEnabled () |
Get reachability service status. More... | |
Lifecycle | |
static void | create (@NonNull Context context,@NonNull String token,@NonNull Properties properties,@NonNull CallbackListener< ChatClient > listener) |
Creates a new Chat client instance with a token manager and client properties. More... | |
void | updateToken (String token, StatusListener listener) |
Method to update the authentication token for this client. More... | |
void | shutdown () |
Cleanly shuts down the messaging client when you are done with it. More... | |
Chat client - main entry point for the Chat SDK.
void com.twilio.chat.ChatClient.addListener | ( | @NonNull ChatClientListener | listener | ) |
Method to add listener for this Client.
listener | the listener to add. |
|
static |
Creates a new Chat client instance with a token manager and client properties.
Callback listener is invoked with reference to ChatClient when client initialization is completed.
context | The Application Context from your Android application. Make sure you don't pass an Activity Context. You can retrieve the Application Context by calling getApplicationContext() on your Activity. Cannot be null. |
token | Access token for Chat service. |
properties | ChatClient initialization properties |
listener | Callback listener that will receive reference to the newly initialized ChatClient. |
Channels com.twilio.chat.ChatClient.getChannels | ( | ) |
Channels available to the ChatClient.
native ConnectionState com.twilio.chat.ChatClient.getConnectionState | ( | ) |
native String com.twilio.chat.ChatClient.getMyIdentity | ( | ) |
Get user identity for current user.
Properties com.twilio.chat.ChatClient.getProperties | ( | ) |
Get properties for current client.
|
static |
Returns the version of the Chat SDK.
Users com.twilio.chat.ChatClient.getUsers | ( | ) |
void com.twilio.chat.ChatClient.handleNotification | ( | NotificationPayload | notification | ) |
Queue the incoming notification with the chat library for processing.
You must call this function if you want the chat library to call your ChatClientListener.onAddedToChannelNotification(), ChatClientListener.onInvitedToChannelNotification(), ChatClientListener.onRemovedFromChannelNotification(), or ChatClientListener.onNewMessageNotification() callbacks.
notification | Notification received from GCM or FCM. |
native boolean com.twilio.chat.ChatClient.isReachabilityEnabled | ( | ) |
Get reachability service status.
void com.twilio.chat.ChatClient.registerFCMToken | ( | FCMToken | token, |
StatusListener | listener | ||
) |
Register Firebase Messaging token for push notification updates.
token | The registration token an Android application needs to register with FCM connection servers before it can receive messages. |
listener | Listener that will receive callback with the result. |
void com.twilio.chat.ChatClient.registerGCMToken | ( | GCMToken | token, |
StatusListener | listener | ||
) |
Register GCM token for push notification updates.
token | The registration token an Android application needs to register with GCM connection servers before it can receive messages. |
listener | Listener that will receive callback with the result. |
void com.twilio.chat.ChatClient.removeListener | ( | @NonNull ChatClientListener | listener | ) |
Method to remove listener from this Client.
listener | the listener to remove. |
|
static |
Set verbosity level for log messages to be printed to android logcat.
Default log level is LogLevel#SILENT.
level | Verbosity level. See LogLevel for supported options. |
void com.twilio.chat.ChatClient.shutdown | ( | ) |
void com.twilio.chat.ChatClient.unregisterFCMToken | ( | FCMToken | token, |
StatusListener | listener | ||
) |
Unregister from Firebase Messaging updates.
token | The FCMToken to unregister. Must be the same token that was passed in registerFCMToken before. |
listener | Listener that will receive callback with the result. |
void com.twilio.chat.ChatClient.unregisterGCMToken | ( | GCMToken | token, |
StatusListener | listener | ||
) |
Unregister from push notification updates.
token | The GCMToken to unregister. Must be the same token that was passed in registerGCMToken before. |
listener | Listener that will receive callback with the result. |
void com.twilio.chat.ChatClient.updateToken | ( | String | token, |
StatusListener | listener | ||
) |
Method to update the authentication token for this client.
token | A new access token for this Client. |
listener | Listener that will receive callback with the result. |