Chat SDK for Android v1.3.1
agora java chat SDK
|
The settings of the chat SDK.
You can set parameters and options of the SDK.
For example, whether to encrypt the messages before sending, whether to automatically accept the friend invitations.
void io.agora.chat.ChatOptions.allowChatroomOwnerLeave | ( | boolean | allowed | ) |
Sets whether to allow the chat room owner to leave the chat room.
allowed | Whether to allow the chat room owner to leave the chat room.
|
boolean io.agora.chat.ChatOptions.autoAcceptGroupInvitations | ( | ) |
Gets whether to accept group invitations automatically.
true
: Accept group invitations automatically.false
: Do not accept group invitations automatically. boolean io.agora.chat.ChatOptions.canChatroomOwnerLeave | ( | ) |
Gets whether to allow owner of chat room to leave.
true
: Yes.false
: No. The chat room owner cannot leave the chat room. boolean io.agora.chat.ChatOptions.deleteMessagesOnLeaveChatroom | ( | ) |
Gets whether to delete the chat room message when leaving the chat room.
true
: Delete the chat room related message record when leaving the chat room.false
: Do not delete the chat room related message record when leaving the chat room. boolean io.agora.chat.ChatOptions.deleteMessagesOnLeaveGroup | ( | ) |
Gets whether to delete the group message when leaving a group.
true
: Delete the messages when leaving a group.false
: Do not delete the messages when leaving a group. void io.agora.chat.ChatOptions.enableDNSConfig | ( | boolean | enable | ) |
Sets whether to disable DNS.
enable | Whether to disable DNS:
|
boolean io.agora.chat.ChatOptions.getAcceptInvitationAlways | ( | ) |
Gets whether to accept other user's friend invitations automatically.
true
: Accepting friend invitation automatically.false
: Do not accepting friend invitation automatically. String io.agora.chat.ChatOptions.getAccessToken | ( | ) |
Gets the access token from the local database.
String io.agora.chat.ChatOptions.getAccessToken | ( | boolean | b | ) |
Whether to get the access token from the server.
b | Whether to get the access token from server.
|
String io.agora.chat.ChatOptions.getAppKey | ( | ) |
Gets the app key.
int io.agora.chat.ChatOptions.getAreaCode | ( | ) |
Gets the area code.
This parameter is used to restrict the scope of accessible edge nodes.
boolean io.agora.chat.ChatOptions.getAutodownloadThumbnail | ( | ) |
Gets whether to download the thumbnails automatically.
true
: Yes;false
: No. boolean io.agora.chat.ChatOptions.getAutoLogin | ( | ) |
Checks whether the automatic login is enabled.
true
: Automatic login is enabled;false
: Automatic login is disabled. boolean io.agora.chat.ChatOptions.getAutoTransferMessageAttachments | ( | ) |
Gets whether to upload the message attachments automatically to the chat server.
true
: Yes.false
: No. A custom path is used to for uploading. String io.agora.chat.ChatOptions.getCustomDeviceName | ( | ) |
Gets the custom name of the current device.
int io.agora.chat.ChatOptions.getCustomOSPlatform | ( | ) |
Gets the custom platform code of a login device.
String io.agora.chat.ChatOptions.getDnsUrl | ( | ) |
Gets the DNS url.
boolean io.agora.chat.ChatOptions.getEnableDNSConfig | ( | ) |
Gets whether DNS is disabled.
true
: Yes;false
: No.int io.agora.chat.ChatOptions.getFixedInterval | ( | ) |
Gets the fixed heartbeat interval.
int io.agora.chat.ChatOptions.getImPort | ( | ) |
Gets the custom IM server port.
String io.agora.chat.ChatOptions.getImServer | ( | ) |
Gets the custom IM message server URL.
String io.agora.chat.ChatOptions.getLoginCustomExt | ( | ) |
Gets the custom device extension information.
String io.agora.chat.ChatOptions.getNativeLibBasePath | ( | ) |
Gets the path of native library.
PushConfig io.agora.chat.ChatOptions.getPushConfig | ( | ) |
Gets the push configurations.
String io.agora.chat.ChatOptions.getReportServer | ( | ) |
Gets the URL of the custom server for data reporting.
boolean io.agora.chat.ChatOptions.getRequireAck | ( | ) |
Gets whether the read receipt is required by the message receiver.
true
: The read receipt is required;false
: The read receipt is not required. boolean io.agora.chat.ChatOptions.getRequireDeliveryAck | ( | ) |
Gets whether the delivery receipt is required.
true
: The read receipt is required;false
: The read receipt is not required. String io.agora.chat.ChatOptions.getRestServer | ( | ) |
Gets the custom REST server URL.
boolean io.agora.chat.ChatOptions.getUsingHttpsOnly | ( | ) |
Gets whether only HTTPS is used for REST operations.
true
: Only HTTPS is used;false
: Both HTTP and HTTPS can be used. String io.agora.chat.ChatOptions.getVersion | ( | ) |
Gets the SDK version.
boolean io.agora.chat.ChatOptions.isAutoAcceptGroupInvitation | ( | ) |
Gets whether to accept a group invitation automatically.
true
: Accept group invitations automatically;false
: Do not accept group invitations automatically.boolean io.agora.chat.ChatOptions.isAutoLoadAllConversations | ( | ) |
Gets whether to automatically load all conversations into the memory upon a successful login.
true
: Automatically load all conversations.false
: Do not automatically load all conversations. boolean io.agora.chat.ChatOptions.isChatroomOwnerLeaveAllowed | ( | ) |
Gets whether to allow the owner of chat room to leave.
true
: Yes. Even if the chat room owner leaves the chat room, the owner still has all privileges, except for receiving messages in the chat room.false
: When the owner leave do keep the conversation. boolean io.agora.chat.ChatOptions.isDeleteMessagesAsExitChatRoom | ( | ) |
Gets whether to delete the chat room message when leaving the chat room.
true
: Delete the chat room related message record when leaving the chat room.false
: Do not delete the chat room related message record when leaving the chat room.boolean io.agora.chat.ChatOptions.isDeleteMessagesAsExitGroup | ( | ) |
Gets whether to delete the group message when leaving a group.
true
: Delete the messages when leaving a group.false
: Do not delete the messages when leaving a group.
boolean io.agora.chat.ChatOptions.isEnableStatistics | ( | ) |
Checks whether the traffic statistics collection is enabled for local messages.
true
: Enabled;false
: Disabled. boolean io.agora.chat.ChatOptions.isEnableTLSConnection | ( | ) |
Gets whether the TLS connection is enabled.
true
: The TLS connection is enabled.false
: The TLS connection is disabled. boolean io.agora.chat.ChatOptions.isIncludeSendMessageInMessageListener | ( | ) |
Whether the sent message is included in MessageListener#onMessageReceived(java.util.List).
true
: Yes. Besides the received message, the sent message is also included in MessageListener#onMessageReceived(java.util.List).false
: No. Only the received message is included in MessageListener#onMessageReceived(java.util.List). boolean io.agora.chat.ChatOptions.isLoadEmptyConversations | ( | ) |
Checks whether to include empty conversations when the SDK loads conversations from the local database.
false
: Empty conversations are excluded.true
: Empty conversations are included. boolean io.agora.chat.ChatOptions.isSortMessageByServerTime | ( | ) |
Gets whether to sort messages by the time when the server received them.
true
: Yes. Messages are sorted by the time when the server received them;false
: No. Messages are not sorted by the time when the server received them. boolean io.agora.chat.ChatOptions.isUseReplacedMessageContents | ( | ) |
Gets whether the server returns the sender the text message with the content replaced during text moderation.
true
: Yes.false
: No. The server returns the original message to the sender. boolean io.agora.chat.ChatOptions.regardImportedMsgAsRead | ( | ) |
\~english Whether to set messages imported from the server side as read. @return Whether to set messages imported from the server side as read: - `true`: Read. After the messages are imported, the number of unread messages returned by `Conversation#getUnreadMsgCount() remains unchanged.
remains unchanged.
: Unread. After the messages are imported, the number of unread messages returned by
Conversation::getUnreadMsgCount() is increased. void io.agora.chat.ChatOptions.setAcceptInvitationAlways | ( | boolean | value | ) |
Sets whether to accept the friend invitation automatically.
value | Whether to accept the friend invitation automatically.
|
void io.agora.chat.ChatOptions.setAppKey | ( | String | appkey | ) |
Sets the app key.
appkey | The app key you got from the console when creating an app. |
void io.agora.chat.ChatOptions.setAreaCode | ( | int | code | ) |
Sets the area code.
code | The area code. This parameter is used to restrict the scope of accessible edge nodes. The default value is AREA_CODE_GLOB , indicating that no restriction is placed on the scope of accessible edge nodes. The parameter setting cannot be changed during the app runtime. |
void io.agora.chat.ChatOptions.setAutoAcceptGroupInvitation | ( | boolean | value | ) |
Sets whether to accept a group invitation automatically.
value | Whether to accept group invitation automatically.
|
void io.agora.chat.ChatOptions.setAutoDownloadThumbnail | ( | boolean | autodownload | ) |
Sets whether to automatically download thumbnails.
autodownload | Whether to download the thumbnails automatically.
|
void io.agora.chat.ChatOptions.setAutoLoadAllConversations | ( | boolean | autoLoadAllConversations | ) |
Sets whether to automatically load all conversations into the memory upon a successful login.
As for the call sequence, this method comes before ChatClient#init(Context, ChatOptions).
autoLoadAllConversations | Whether to automatically load all conversations.
|
void io.agora.chat.ChatOptions.setAutoLogin | ( | boolean | autoLogin | ) |
Enables/Disables automatic login.
autoLogin | Whether to enable automatic login:
|
void io.agora.chat.ChatOptions.setAutoTransferMessageAttachments | ( | boolean | transfer | ) |
Sets whether to upload the message attachments automatically to the chat server.
transfer | Whether to automatically upload the message attachments to the chat server.
|
void io.agora.chat.ChatOptions.setCustomDeviceName | ( | @NonNull String | customDeviceName | ) |
Sets a custom name for the current device.
Setting a custom name for the current device is intended to differentiate devices during multi-device login scenarios.
You can call ChatClient#getLoggedInDevicesFromServer(String, String) to get the information of login devices of a specified account.
You can set the custom name for the current device before calling ChatClient#init(Context, ChatOptions).
customDeviceName | The custom name for the current device. The parameter value cannot be null or an empty string. The default value is the device model such as HUAWEICOL-AL10. |
void io.agora.chat.ChatOptions.setCustomOSPlatform | ( | int | platform | ) |
Sets a custom platform code for the login device.
You need to set the custom platform code before calling ChatClient#init(Context, ChatOptions).
platform | The custom platform code. The value range is 1-100. |
void io.agora.chat.ChatOptions.setDeleteMessagesAsExitChatRoom | ( | boolean | delete | ) |
Sets whether to delete the chat room message when leaving the chat room.
delete | Whether to delete the chat room message when leaving the chat room:
|
void io.agora.chat.ChatOptions.setDeleteMessagesAsExitGroup | ( | boolean | delete | ) |
Sets whether to delete the group messages when leaving the group.
delete |
|
void io.agora.chat.ChatOptions.setDnsUrl | ( | String | dnsUrl | ) |
Sets the DNS url.
dnsUrl | The DNS url. |
void io.agora.chat.ChatOptions.setEnableStatistics | ( | boolean | enableStatistics | ) |
Sets whether to enable traffic statistics collection for local messages.
You need to enable traffic statistics collection before calling ChatClient#init(Context, ChatOptions).
enableStatistics | Whether to enable the message traffic statistics collection:
|
void io.agora.chat.ChatOptions.setEnableTLSConnection | ( | boolean | enableTLSConnection | ) |
Sets whether to enable the TLS connection.
This setting is used only in private deployment.
As for the call sequence, this method comes before ChatClient#init(Context, ChatOptions).
enableTLSConnection | Whether to enable the TLS connection.
|
void io.agora.chat.ChatOptions.setFixedHBInterval | ( | int | interval | ) |
Sets a fixed heartbeat interval.
If not set, the optimal heartbeat interval is automatically detected.
interval | The interval of heartbeat in seconds. The recommended value range is 30-300. |
void io.agora.chat.ChatOptions.setImPort | ( | int | imPort | ) |
Sets the custom IM server port.
imPort | The custom IM server port. |
void io.agora.chat.ChatOptions.setIMServer | ( | String | imServer | ) |
Sets the custom IM message server URL.
imServer | The custom IM message server URL. |
void io.agora.chat.ChatOptions.setIncludeSendMessageInMessageListener | ( | boolean | include | ) |
Sets whether the sent message is included in MessageListener#onMessageReceived(java.util.List).
include | Whether the sent message is included in MessageListener#onMessageReceived(java.util.List).
|
void io.agora.chat.ChatOptions.setLoadEmptyConversations | ( | boolean | isLoadEmptyConversations | ) |
Sets whether to include empty conversations when the SDK loads conversations from the local database.
As for the call sequence, this method comes before ChatClient#init(Context, ChatOptions).
isLoadEmptyConversations | Whether to include empty conversations when the SDK loads conversations from the local database:
|
void io.agora.chat.ChatOptions.setLoginCustomExt | ( | @NonNull String | ext | ) |
Sets custom extension information for the current device.
If the SDK is not initialized or automatic login is used, you need to set the extension information of the current device before you call the method. If the SDK is initialized and manual login is used, you can set the extension information before your next call to the ChatClient#login(String,String,CallBack) or ChatClient#loginWithToken(String,String,CallBack) method.
ext | The custom extension information for the current device. The extension information can contain up to 1024 characters and cannot be null . |
The extension information is contained in the notification sent to the device that is kicked offline due to the user's login to the current device.
void io.agora.chat.ChatOptions.setNativeLibBasePath | ( | @NonNull String | path | ) |
Sets the path of the native library.
path | The path of the native library.
|
void io.agora.chat.ChatOptions.setPushConfig | ( | PushConfig | pushConfig | ) |
Sets the push options.
pushConfig | The push configuration. |
void io.agora.chat.ChatOptions.setRegardImportedMsgAsRead | ( | boolean | regardImportedMsgAsRead | ) |
\~english Sets whether to set messages imported from the server side as read. @return Whether to set messages imported from the server side as read: - `true`: Read. After the messages are imported, the number of unread messages returned by `Conversation#getUnreadMsgCount() remains unchanged.
remains unchanged.
: Unread. After the messages are imported, the number of unread messages returned by
Conversation::getUnreadMsgCount() is increased. void io.agora.chat.ChatOptions.setReportServer | ( | String | reportServer | ) |
Sets the URL of the custom server for data reporting.
reportServer | The URL of the custom server for data reporting. |
void io.agora.chat.ChatOptions.setRequireAck | ( | boolean | requireAck | ) |
Sets whether to require the read receipt.
requireAck | Whether the read receipt is required.
|
void io.agora.chat.ChatOptions.setRequireDeliveryAck | ( | boolean | requireDeliveryAck | ) |
Sets whether the delivery receipt is required.
requireDeliveryAck | Whether the delivery receipt is required.
|
void io.agora.chat.ChatOptions.setRestServer | ( | String | restServer | ) |
Sets the custom REST server URL.
restServer | The custom REST server URL. |
void io.agora.chat.ChatOptions.setSortMessageByServerTime | ( | boolean | sortByServerTime | ) |
Sets whether to sort messages by the time when the server received them.
sortByServerTime | Whether to sort messages by the time when the server received them:
|
void io.agora.chat.ChatOptions.setUseReplacedMessageContents | ( | boolean | useReplacedMessageContents | ) |
Sets whether the server returns the sender the text message with the content replaced during text moderation:
As for the call sequence, this method comes before ChatClient#init(Context, ChatOptions).
useReplacedMessageContents | Whether to return the adjusted message to the sender:
|
void io.agora.chat.ChatOptions.setUsingHttpsOnly | ( | boolean | _usingHttpsOnly | ) |
Sets whether only HTTPS is used for REST operation.
_usingHttpsOnly | Whether only HTTPS is used.
|