|
Chat Android SDK
4.2.9
|
Chat client - main entry point for the Chat SDK. More...
Classes | |
| enum | ConnectionState |
| Represents underlying twilsock connection state. 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 | setListener (ChatClientListener listener) |
| Method to set listener for this Client. More... | |
| void | removeListener () |
| Method to remove listener for this Client. | |
Push notifications | |
| void | registerGCMToken (String token, StatusListener listener) |
| Register GCM token for push notification updates. More... | |
| void | unregisterGCMToken (String token, StatusListener listener) |
| Unregister from push notification updates. More... | |
| void | registerFCMToken (String token, StatusListener listener) |
| Register Firebase Messaging token for push notification updates. More... | |
| void | unregisterFCMToken (String 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... | |
| native Channels | getChannels () |
| Channels available to the ChatClient. More... | |
| native ConnectionState | getConnectionState () |
| native String | getMyIdentity () |
| Get user identity for current user. More... | |
| native 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.
|
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. |
| native 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.
| native 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 | ( | String | 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 | ( | String | 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.setListener | ( | ChatClientListener | listener | ) |
Method to set listener for this Client.
| listener | the listener for this Client. |
|
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 | ( | ) |
Cleanly shuts down the messaging client when you are done with it.
It will dispose() the client after shutdown, so it could not be reused.
| void com.twilio.chat.ChatClient.unregisterFCMToken | ( | String | token, |
| StatusListener | listener | ||
| ) |
Unregister from Firebase Messaging updates.
| token | The registration token provided for FCM push notification registration. |
| listener | Listener that will receive callback with the result. |
| void com.twilio.chat.ChatClient.unregisterGCMToken | ( | String | token, |
| StatusListener | listener | ||
| ) |
Unregister from push notification updates.
| token | The registration token provided for GCM push notification registration. |
| 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. |